Forward arguments correctly: use "$@" instead of $*

Also added an exec to improve performance (which replaces the current process instead of spawning a subshell),
and changed the shebang to #!/usr/bin/env as this is best practice.
This commit is contained in:
James Ko 2016-02-18 00:47:09 -05:00
parent 445b4bd453
commit 9a40a06a46

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
@ -27,10 +27,10 @@ function code() {
# Launch Code
if [[ "$OSTYPE" == "darwin"* ]]; then
./.build/electron/Electron.app/Contents/MacOS/Electron . $*
exec ./.build/electron/Electron.app/Contents/MacOS/Electron . "$@"
else
./.build/electron/electron . $*
exec ./.build/electron/electron . "$@"
fi
}
code $*
code "$@"