From d749ef2a3c1e80840502b0d491f7baf72d8964c2 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 30 Aug 2020 14:49:36 +0800 Subject: [PATCH] Fix the path contains spaces lead to tool script failure (#117) --- _scripts/sh/sync_monitor.sh | 2 +- tools/build.sh | 2 +- tools/publish.sh | 3 ++- tools/pv.sh | 4 ++-- tools/run.sh | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/_scripts/sh/sync_monitor.sh b/_scripts/sh/sync_monitor.sh index fa748963d18..ae4b8953bb7 100644 --- a/_scripts/sh/sync_monitor.sh +++ b/_scripts/sh/sync_monitor.sh @@ -15,7 +15,7 @@ if [[ ! -f "$1" ]]; then exit 0 fi -src_dir="$(dirname $(realpath "$1"))" +src_dir="$(dirname "$(realpath "$1")")" dir_prefix="$(realpath "$2")/" diff --git a/tools/build.sh b/tools/build.sh index db9ff0cabc8..a05712c5aaa 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -10,7 +10,7 @@ set -eu CMD="JEKYLL_ENV=production bundle exec jekyll b" -WORK_DIR="$(dirname $(dirname $(realpath "$0")))" +WORK_DIR="$(dirname "$(dirname "$(realpath "$0")")")" CONTAINER="${WORK_DIR}/.container" diff --git a/tools/publish.sh b/tools/publish.sh index 755d0aea73f..84bad211db6 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -13,7 +13,8 @@ CATEGORIES=false TAGS=false LASTMOD=false -WORK_DIR="$(dirname $(dirname $(realpath "$0")))" +WORK_DIR="$(dirname "$(dirname "$(realpath "$0")")")" + check_status() { local _change=$(git status . -s) diff --git a/tools/pv.sh b/tools/pv.sh index 19a9b92a948..e26ba10d270 100755 --- a/tools/pv.sh +++ b/tools/pv.sh @@ -15,7 +15,7 @@ set -eu -WORK_DIR="$(dirname $(dirname $(realpath "$0")))" +WORK_DIR="$(dirname "$(dirname "$(realpath "$0")")")" URL_FILE="${WORK_DIR}/_config.yml" PV_CACHE="${WORK_DIR}/assets/js/data/pageviews.json" @@ -23,4 +23,4 @@ PROXY_URL="$(grep "proxy_endpoint:" "$URL_FILE" | sed "s/.*: '//g;s/'.*//")" wget "$PROXY_URL" -O "$PV_CACHE" -echo "ls $PV_CACHE" \ No newline at end of file +echo "ls $PV_CACHE" diff --git a/tools/run.sh b/tools/run.sh index f7796d87fa0..471fe043001 100755 --- a/tools/run.sh +++ b/tools/run.sh @@ -12,7 +12,7 @@ set -eu -WORK_DIR=$(dirname $(dirname $(realpath "$0"))) +WORK_DIR="$(dirname "$(dirname "$(realpath "$0")")")" CONTAINER=.container SYNC_TOOL=_scripts/sh/sync_monitor.sh