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:
Cody Boone Ferguson committed 2023-02-16 04:38:40 -08:00
1 parent 3e932602c3
commit 05e83b60ff
1 file changed
+9 -5
+9 -5
View File
@@ -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++))