Skip to content

Commit 1cc9ae9

Browse files
committed
fix: forward jq args in profile updates
1 parent 40bf218 commit 1cc9ae9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/lib/profile-io.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ write_profile() {
3434
fi
3535
}
3636

37-
# Update profile atomically: takes a jq filter, applies it in one pass.
37+
# Update profile atomically: forwards jq args and applies them in one pass.
3838
# Usage: update_profile '.xp += 10'
39+
# update_profile --arg tech "$TECH" '.concepts_seen += [$tech]'
3940
# Requires jq to be installed; callers should guard with `command -v jq`.
4041
update_profile() {
41-
local filter="$1"
4242
local current
4343
current=$(read_profile)
44-
echo "$current" | jq "$filter" | write_profile
44+
printf '%s\n' "$current" | jq "$@" | write_profile
4545
}

0 commit comments

Comments
 (0)