From dd73aababea2ed4aedf00d08b657fe6af89f06e4 Mon Sep 17 00:00:00 2001 From: William Esz Date: Tue, 21 Feb 2017 21:22:01 +0100 Subject: [PATCH] Escape paths (related to #21010) --- scripts/code.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/code.sh b/scripts/code.sh index 4ce722d2b27..bda04bb880c 100755 --- a/scripts/code.sh +++ b/scripts/code.sh @@ -2,13 +2,13 @@ if [[ "$OSTYPE" == "darwin"* ]]; then realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } - ROOT=$(dirname $(dirname $(realpath "$0"))) + ROOT=$(dirname "$(dirname "$(realpath "$0")")") else - ROOT=$(dirname $(dirname $(readlink -f $0))) + ROOT=$(dirname "$(dirname "$(readlink -f $0)")") fi function code() { - cd $ROOT + cd "$ROOT" if [[ "$OSTYPE" == "darwin"* ]]; then NAME=`node -p "require('./product.json').nameLong"` @@ -41,7 +41,4 @@ function code() { exec "$CODE" . "$@" } -# Use the following to get v8 tracing: -# code --js-flags="--trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces" "$@" - code "$@"