Skip to content

Commit

Permalink
fix update path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dingyiyi0226 committed Apr 29, 2021
1 parent 6dbe15c commit e3a7289
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libexec/spc-update
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for config in "$@"; do
## create or update config
## In order to use `sed` on both linux and macos, generate backup file and delete it
if grep -q "^${config_key}=.*" "${filename}"; then
sed -i.bak "s/^${config_key}=.*/${config}/g" "${filename}"
sed -i.bak "s@^${config_key}=.*@${config}@g" "${filename}" # config would contain '/', so change the syntax to '@'
rm "${filename}.bak"
else
echo "${config}" >> "${filename}"
Expand Down

0 comments on commit e3a7289

Please sign in to comment.