Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make bin/build more idiomatic

* `printf` is more portable and consistent than `echo`
* $( ) is allowed and preferred
* Always quote all variables
* Useless use of `cat`
* Remove uneeded permissions setting
  • Loading branch information...
commit a5f3ff1962ba0ec5272acceaa10e0104efccd147 1 parent 3bf8ea0
@pbrisbin pbrisbin authored
Showing with 8 additions and 10 deletions.
  1. +8 −10 bin/build.sh
View
18 bin/build.sh
@@ -1,18 +1,16 @@
#!/bin/sh
for MANIFEST in Manifest.*; do
- FILENAME=`echo -n "$MANIFEST" | sed s/Manifest\.//`
- rm -f $FILENAME
+ FILENAME=$(printf "$MANIFEST" | sed s/Manifest\.//)
+ rm -f "$FILENAME"
- echo "\nBuilding $MANIFEST into $FILENAME"
+ printf "\nBuilding $MANIFEST into $FILENAME\n"
- for file in `cat $MANIFEST`; do
- echo "Including: $file"
+ while read file; do
+ printf "Including: $file\n"
- cat $file >> $FILENAME
+ cat "$file" >> "$FILENAME"
- echo "### end $file\n" >> $FILENAME
- done
-
- chmod 755 $FILENAME
+ printf "### end $file\n\n" >> "$FILENAME"
+ done < "$MANIFEST"
done
Please sign in to comment.
Something went wrong with that request. Please try again.