mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
handle GIT_EDITOR which contains space
This commit is contained in:
parent
afce25cd65
commit
a192fe688a
|
|
@ -478,7 +478,10 @@ main() {
|
|||
rm -f "$tmpfile"
|
||||
else
|
||||
cp -f "$tmpfile" "$changelog"
|
||||
[[ -n "$GIT_EDITOR" ]] && $GIT_EDITOR "$changelog"
|
||||
# Use `eval` to handle GIT_EDITOR which contains space and options,
|
||||
# like ""C:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst ".
|
||||
# Thanks @JanSchulz to inspire me this solution
|
||||
[[ -n "$GIT_EDITOR" ]] && eval $GIT_EDITOR "$changelog"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
_exit
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue