GetStream / vg

Virtualgo: Easy and powerful workspace based development for go
MIT License
1.32k stars 45 forks source link

sh: clean up some issues caught by shellcheck #18

Closed glasser closed 7 years ago

glasser commented 7 years ago

The most important bits here are quoting the $@ invocations, especially in vg globalExec; without this, trying to pass arguments containing spaces to the program exec'd by vg globalExec will fail. Some other instances are helpful if your home directory has a space in its path. Some of the other quotes are perhaps extraneous (eg, with echo), but it's a good habit to be in anyway.

glasser commented 7 years ago

Note: I don't know much about zsh and haven't tested there.

JelteF commented 7 years ago

Good finds. Hadn't heard about shellcheck before but installed it right away, seems to give good suggestions.

glasser commented 7 years ago

BTW, as far as dropping the eval in globalExec: keeping it in seemed to break vg globalExec echo 'foo bar' and I think it still allows for most of the things you'd expect from an eval (eg you can globalExec a cd and it works), but I'm not an expert.