Merge pull request #21016 from flagello/escape_paths_code_bash_script

Escape paths in code.sh
This commit is contained in:
João Moreno 2017-04-11 16:05:01 +02:00 committed by GitHub
commit e359d83c06

View file

@ -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 "$@"