From 2d7df507745e688826a72663db2babd8f95ca793 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 fa74896..ae4b895 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 db9ff0c..a05712c 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 755d0ae..84bad21 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 19a9b92..e26ba10 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 f7796d8..471fe04 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