Browse Source

adds directory testing before file moves (bugfix for move errors when git does not clone an empty existing directory)

Chris Simpkins 7 years ago
parent
commit
14f8d41f32
4 changed files with 30 additions and 1 deletions
  1. 10 0
      build-subsets.sh
  2. 7 0
      build-ttf.sh
  3. 6 0
      build-woff.sh
  4. 7 1
      build-woff2.sh

+ 10 - 0
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..."
 

+ 7 - 0
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

+ 6 - 0
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"

+ 7 - 1
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"