Add quotes to cd command in scm_breeze.sh to fix bash eval error

This commit is contained in:
Andy Zhang
2012-10-12 02:31:55 -04:00
parent b92c2da2fc
commit 2ec1bf344f

View File

@@ -41,7 +41,7 @@ _create_or_patch_scmbrc() {
# Create diff of example file, substituting example file for user's config. # Create diff of example file, substituting example file for user's config.
git diff $1 "$prefix""scmbrc.example" | sed "s/$prefix""scmbrc.example/.$prefix""scmbrc/g" > $patchfile git diff $1 "$prefix""scmbrc.example" | sed "s/$prefix""scmbrc.example/.$prefix""scmbrc/g" > $patchfile
if [ -s $patchfile ]; then # If patchfile is not empty if [ -s $patchfile ]; then # If patchfile is not empty
cd $HOME cd "$HOME"
# If the patch cannot be applied cleanly, show the updates and tell user to update file manually. # If the patch cannot be applied cleanly, show the updates and tell user to update file manually.
if ! patch -f "$HOME/.$prefix""scmbrc" $patchfile; then if ! patch -f "$HOME/.$prefix""scmbrc" $patchfile; then
printf "== \e[0;31mUpdates could not be applied to '\e[1m~/.$prefix""scmbrc\e[0;31m'.\e[0m\n" printf "== \e[0;31mUpdates could not be applied to '\e[1m~/.$prefix""scmbrc\e[0;31m'.\e[0m\n"