Bug fix sgit - new version 0.0.5-1 16-02-2023
A problem existed where more than one command would not work (always or
in some conditions depending on the command: not sure which). This
prevented a fix in years.html which will be in the next commit. The sgit
repo has been updated with this fix as well.
The fix is to remove space from IFS and to change "${SED_COMMANDS[*]}"
to be "${SED_COMMANDS[@]}".
This commit is contained in:
1 parent
3e932602c3
commit
05e83b60ff
1 file changed
+9
-5
@@ -16,7 +16,7 @@
|
||||
# - Cody Boone Ferguson (@xexyl)
|
||||
#
|
||||
|
||||
export SGIT_VERSION="0.0.4-1 15-02-2023" # format: major.minor.patch-release DD-MM-YYYY
|
||||
export SGIT_VERSION="0.0.5-1 16-02-2023" # format: major.minor.patch-release DD-MM-YYYY
|
||||
|
||||
USAGE="usage: $(basename "$0") [-h] [-V] [-v level] [-x] [-I] [-o sed_options] [-s sed] [-e command] <glob...>
|
||||
|
||||
@@ -39,6 +39,10 @@ export VERBOSITY=0
|
||||
|
||||
# we need an array for sed commands
|
||||
declare -a SED_COMMANDS
|
||||
|
||||
# we need to remove ' ' from the IFS!
|
||||
IFS=$'\t\n'
|
||||
|
||||
# parse args
|
||||
#
|
||||
while getopts :hVv:xIo:s:e: flag; do
|
||||
@@ -162,15 +166,15 @@ while [[ "$i" -le "$#" ]]; do
|
||||
|
||||
if [[ -z "$I_FLAG" ]]; then
|
||||
if [[ -n "$SED_OPTIONS" ]]; then
|
||||
git ls-files "$1" | xargs "$SED" -i"" "$SED_OPTIONS" "${SED_COMMANDS[*]}"
|
||||
git ls-files "$1" | xargs "$SED" -i"" "$SED_OPTIONS" "${SED_COMMANDS[@]}"
|
||||
else
|
||||
git ls-files "$1" | xargs "$SED" -i"" "${SED_COMMANDS[*]}"
|
||||
git ls-files "$1" | xargs "$SED" -i"" "${SED_COMMANDS[@]}"
|
||||
fi
|
||||
else
|
||||
if [[ -n "$SED_OPTIONS" ]]; then
|
||||
git ls-files "$1" | xargs "$SED" "$SED_OPTIONS" "${SED_COMMANDS[*]}"
|
||||
git ls-files "$1" | xargs "$SED" "$SED_OPTIONS" "${SED_COMMANDS[@]}"
|
||||
else
|
||||
git ls-files "$1" | xargs "$SED" "${SED_COMMANDS[*]}"
|
||||
git ls-files "$1" | xargs "$SED" "${SED_COMMANDS[@]}"
|
||||
fi
|
||||
fi
|
||||
((i++))
|
||||
|
||||
Reference in new issue
Block a user