From 05e83b60ff95279ef652a45f24d9d6eede5bfd69 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 16 Feb 2023 04:32:34 -0800 Subject: [PATCH] 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[@]}". --- bin/sgit | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/sgit b/bin/sgit index f6c72db25..bb7e6fe9d 100755 --- a/bin/sgit +++ b/bin/sgit @@ -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] @@ -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++))