From 9a40a06a46b2cf34c4ae676d97e7641c2c5b8a53 Mon Sep 17 00:00:00 2001 From: James Ko Date: Thu, 18 Feb 2016 00:47:09 -0500 Subject: [PATCH] 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. --- scripts/code.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/code.sh b/scripts/code.sh index 6f080650a64..3d26cbce68b 100755 --- a/scripts/code.sh +++ b/scripts/code.sh @@ -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 "$@"