git-dude
git-dude copied to clipboard
Breaks with parenthesis in the repo name
If i have a repo with a parenthesis in the name the script breaks when running eval
icon_path=/home/grok/code/salt-states/icon.png
cd "$dir_name"; git rev-parse --git-dir 2>/dev/null
cd "$dir_name"; git config dude.ignore
basename "$dir_name" .git
git config dude.remote || true
git fetch $remote 2>&1 | grep -F -- '->' | sed 's/^ [+*=!-] //'
git config dude.icon || true
pwd
icon_path=/home/grok/code/salt-states\ (copy)/icon.png
/home/grok/bin/git-dude: eval: line 67: syntax error near unexpected token `('
The dude.remote
support was added in my fork. Created a pull request #43 just now to upstream into this repository. It's likely that this issue is not related to dude.remote
, but anyhow I wanted to let you know to avoid any confusion.
icon_path=$(git config dude.icon || true) icon_path=${icon_path:-`pwd`/icon.png} icon_path=${icon_path// /\\ } # escape spaces before eval eval icon_path=$icon_path # to expand ~
Fails when you have a directory with ( or ) Fixed by this:
icon_path=$(git config dude.icon || true) icon_path=${icon_path:-`pwd`/icon.png} icon_path=${icon_path// /\\ } # escape spaces before eval icon_path=${icon_path//(/\\ } # escape brackets before eval icon_path=${icon_path//)/\\ } # escape brackens before eval eval icon_path=$icon_path # to expand ~