Skip to content

Commit

Permalink
Fix eval
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorenar committed Oct 30, 2023
1 parent 5c58080 commit 3d1cde8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-fmt-diff
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,17 @@ process_file () (
return
fi

fmtcmd="$tempdir"/fmtcmd
rm_list__push "$fmtcmd"
echo "$formatter" > "$fmtcmd"

# shellcheck disable=SC2086
eval "sh -c '$formatter' < '$b_raw' > '$b_fmt' $g_fmtprg_devnull"
eval "sh '$fmtcmd' < '$b_raw' > '$b_fmt' $g_fmtprg_devnull"
rm_list__push "$b_fmt"

git diff -s "$b_raw" "$b_fmt" && return

eval "sh -c '$formatter' < '$a_raw' > '$a_fmt' $g_fmtprg_devnull"
eval "sh '$fmtcmd' < '$a_raw' > '$a_fmt' $g_fmtprg_devnull"
rm_list__push "$a_fmt"

chng_fmt="$(git_changes_formatted \
Expand Down

0 comments on commit 3d1cde8

Please sign in to comment.