Escape paths (related to #21010)

This commit is contained in:
William Esz 2017-02-21 21:22:01 +01:00
parent 6480172752
commit dd73aababe

View file

@ -2,13 +2,13 @@
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; } realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname $(dirname $(realpath "$0"))) ROOT=$(dirname "$(dirname "$(realpath "$0")")")
else else
ROOT=$(dirname $(dirname $(readlink -f $0))) ROOT=$(dirname "$(dirname "$(readlink -f $0)")")
fi fi
function code() { function code() {
cd $ROOT cd "$ROOT"
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
NAME=`node -p "require('./product.json').nameLong"` NAME=`node -p "require('./product.json').nameLong"`
@ -41,7 +41,4 @@ function code() {
exec "$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 "$@" code "$@"