-
Notifications
You must be signed in to change notification settings - Fork 484
Open
Description
Problem
The development/scripts/op-run.sh script has several issues:
- No argument checking: Running the script without parameters causes
exec "$@"to fail - Invalid variable names: Items from 1Password with titles starting with numbers create invalid shell variable names (e.g.,
3RD_PARTY_API_KEY) - Missing error handling: Using
set -eonly, missing-u(undefined variables) and-o pipefailoptions - Unsafe string handling: Using
echowhich may interpret escape sequences in item titles
Solution
- Add usage prompt when no arguments provided
- Skip items whose sanitized names start with numbers
- Use
set -euo pipefailfor stricter error handling - Use
printf '%s'instead ofechofor safer string handling - Fix jq null handling when no matching account found
Impact
- Prevents script failures when called incorrectly
- Avoids export errors from invalid variable names
- More robust error handling throughout the script
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels