Pārlūkot izejas kodu

shellcheck fixes for ttfautohint-build.sh script, adds CI shellcheck testing for ttfautohint-build.sh script

Chris Simpkins 7 gadi atpakaļ
vecāks
revīzija
039c4669fc
2 mainītis faili ar 18 papildinājumiem un 17 dzēšanām
  1. 1 1
      Makefile
  2. 17 16
      tools/scripts/install/ttfautohint-build.sh

+ 1 - 1
Makefile

@@ -10,7 +10,7 @@ build-with-dependencies: source/*.ufo build/ttf/*.ttf
 
 lint: shellcheck ufolint
 
-shellcheck: build.sh build-woff.sh build-woff2.sh
+shellcheck: build.sh build-woff.sh build-woff2.sh tools/scripts/install/ttfautohint-build.sh
 	$@ $^
 
 ufolint: source/*.ufo

+ 17 - 16
tools/scripts/install/ttfautohint-build.sh

@@ -1,4 +1,5 @@
 #!/bin/sh
+# shellcheck disable=SC2103
 #
 # This script builds a stand-alone binary for the command line version of
 # ttfautohint, downloading any necessary libraries.
@@ -45,7 +46,7 @@ INST="$BUILD/local"
 mkdir "$BUILD"
 mkdir "$INST"
 
-cd "$BUILD"
+cd "$BUILD" || exit 1
 
 
 echo "#####"
@@ -60,21 +61,21 @@ count=0
 for i in $FREETYPE_PATCHES
 do
   curl -o ft-patch-$count.diff $i
-  count=`expr $count + 1`
+  count=$($count + 1)
 done
 
 count=0
 for i in $HARFBUZZ_PATCHES
 do
   curl -o hb-patch-$count.diff $i
-  count=`expr $count + 1`
+  count=$($count + 1)
 done
 
 count=0
 for i in $TTFAUTOHINT_PATCHES
 do
   curl -o ta-patch-$count.diff $i
-  count=`expr $count + 1`
+  count=$($count + 1)
 done
 
 
@@ -98,36 +99,36 @@ echo "#####"
 echo "Apply patches."
 echo "#####"
 
-cd "$FREETYPE"
+cd "$FREETYPE" || exit 1
 for i in ../ft-patch-*.diff
 do
-  test -f $i || continue
+  test -f "$i" || continue
   patch --forward \
         --strip=1 \
         --reject-file=- \
-        < $i
+        < "$i"
 done
 cd ..
 
-cd "$HARFBUZZ"
+cd "$HARFBUZZ" || exit 1
 for i in ../hb-patch-*.diff
 do
-  test -f $i || continue
+  test -f "$i" || continue
   patch --forward \
         --strip=1 \
         --reject-file=- \
-        < $i
+        < "$i"
 done
 cd ..
 
-cd "$TTFAUTOHINT"
+cd "$TTFAUTOHINT" || exit 1
 for i in ../ta-patch-*.diff
 do
-  test -f $i || continue
+  test -f "$i" || continue
   patch --forward \
         --strip=1 \
         --reject-file=- \
-        < $i
+        < "$i"
 done
 cd ..
 
@@ -136,7 +137,7 @@ echo "#####"
 echo "$FREETYPE"
 echo "#####"
 
-cd "$FREETYPE"
+cd "$FREETYPE" || exit 1
 
 ./configure \
   --without-bzip2 \
@@ -158,7 +159,7 @@ echo "#####"
 echo "$HARFBUZZ"
 echo "#####"
 
-cd "$HARFBUZZ"
+cd "$HARFBUZZ" || exit 1
 
 ./configure \
   --disable-dependency-tracking \
@@ -185,7 +186,7 @@ echo "#####"
 echo "$TTFAUTOHINT"
 echo "#####"
 
-cd "$TTFAUTOHINT"
+cd "$TTFAUTOHINT" || exit 1
 
 ./configure \
   --disable-dependency-tracking \