Skip to content

Commit 74dab8d

Browse files
committed
fix: 🐛 argument management
1 parent 9f8e3c5 commit 74dab8d

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/gitutils/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "gitutils",
33
"name": "Git Aliases",
44
"description": "A feature to add useful Git aliases to your shell.",
5-
"version": "5.4.0",
5+
"version": "5.4.1",
66
"dependsOn": {
77
"ghcr.io/devcontainers/features/node:1": "lts",
88
"ghcr.io/tomgrv/devcontainer-features/common-utils:3": {

src/gitutils/install-config.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ eval $(
44
zz_context "$@"
55
)
66

7-
# Detect if --system flag can be used for writing
8-
if git config --system test.key test.value >/dev/null 2>&1; then
9-
GIT_CONFIG_SCOPE="--system"
10-
git config --system --unset test.key
11-
else
12-
GIT_CONFIG_SCOPE="--global"
13-
fi
7+
# Set Context
8+
GIT_CONFIG_SCOPE="--system"
149

1510
# Check if jq is installed
1611
if ! command -v jq >/dev/null 2>&1; then
@@ -34,7 +29,7 @@ if [ -f "$source/alias.json" ]; then
3429
zz_log i "Configuring aliases with {U $source/alias.json}..."
3530
jq -r 'keys[]' $source/alias.json | dos2unix | while read key; do
3631
value=$(jq -r ".$key" $source/alias.json)
37-
git config $GIT_CONFIG_SCOPE alias.$key "!sh -c '$value' -- \"\$@\"" && zz_log - "Created alias {B $key} => {B $value}"
32+
git config $GIT_CONFIG_SCOPE alias.$key "!sh -c \"$value \$@\"" && zz_log - "Created alias {B $key} => {B $value}"
3833
done
3934
fi
4035

0 commit comments

Comments
 (0)