From 14f8d41f3275c7410c992e005820202376a87225 Mon Sep 17 00:00:00 2001 From: Chris Simpkins Date: Tue, 29 Aug 2017 23:17:46 -0400 Subject: [PATCH] adds directory testing before file moves (bugfix for move errors when git does not clone an empty existing directory) --- build-subsets.sh | 10 ++++++++++ build-ttf.sh | 7 +++++++ build-woff.sh | 6 ++++++ build-woff2.sh | 8 +++++++- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/build-subsets.sh b/build-subsets.sh index d49cd3140..2c2620e2c 100755 --- a/build-subsets.sh +++ b/build-subsets.sh @@ -166,6 +166,11 @@ fi # # //////////////////////////////////////////////// +# cleanup any previously created temp directory that was not removed +if ! [ -d "$TEMP_SOURCE" ]; then + rm -rf $TEMP_SOURCE +fi + # create temp directory for subset source files mkdir $TEMP_SOURCE @@ -394,6 +399,11 @@ fi # # ////////////////////////////////////////////// +# create the build directory if it does not exist +if ! [ -d "$WEB_BUILD" ]; then + mkdir $WEB_BUILD +fi + echo " " echo "Moving woff files to build directory..." diff --git a/build-ttf.sh b/build-ttf.sh index 7751e1d8a..fd999b749 100755 --- a/build-ttf.sh +++ b/build-ttf.sh @@ -203,6 +203,13 @@ echo " " # Move release files to build directory echo " " + +# create directory if it does not exist +# (occurs with git + empty directories) +if ! [ -d build/ttf ]; then + mkdir build/ttf +fi + mv master_ttf/hinted/Hack-Regular.ttf build/ttf/Hack-Regular.ttf echo "Regular ttf build path: build/ttf/Hack-Regular.ttf" mv master_ttf/hinted/Hack-Italic.ttf build/ttf/Hack-Italic.ttf diff --git a/build-woff.sh b/build-woff.sh index 2aa8dec57..4c8772a21 100755 --- a/build-woff.sh +++ b/build-woff.sh @@ -136,6 +136,12 @@ fi echo "Moving woff files to build directory..." +# create directory if it does not exist +# (occurs with git + empty directories) +if ! [ -d "$WOFF_BUILD" ]; then + mkdir $WOFF_BUILD +fi + # move woff files to appropriate build directory mv "$TTF_BUILD/$REGULAR_PRE" "$WOFF_BUILD/$REGULAR_WOFF" mv "$TTF_BUILD/$BOLD_PRE" "$WOFF_BUILD/$BOLD_WOFF" diff --git a/build-woff2.sh b/build-woff2.sh index 62b95a490..ee2d58f3e 100755 --- a/build-woff2.sh +++ b/build-woff2.sh @@ -128,7 +128,13 @@ fi echo "Moving woff2 files to build directory..." -# move woff files to appropriate build directory +# create directory if it does not exist +# (occurs with git + empty directories) +if ! [ -d "$WOFF_BUILD" ]; then + mkdir $WOFF_BUILD +fi + +# move woff2 files to appropriate build directory mv "$TTF_BUILD/$REGULAR_PRE" "$WOFF_BUILD/$REGULAR_WOFF" mv "$TTF_BUILD/$BOLD_PRE" "$WOFF_BUILD/$BOLD_WOFF" mv "$TTF_BUILD/$ITALIC_PRE" "$WOFF_BUILD/$ITALIC_WOFF"