Created
September 18, 2009 08:23
-
-
Save sheldonh/188943 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: files/usr/local/bin/concatsnippets.sh | |
=================================================================== | |
--- files/usr/local/bin/concatsnippets.sh (revision 1191) | |
+++ files/usr/local/bin/concatsnippets.sh (working copy) | |
@@ -84,8 +84,14 @@ | |
cd ${WORKDIR} | |
# find all the files in the snippets directory, sort them numerically and concat to snippets.concat in the working dir | |
-/usr/bin/find snippets/ -type f -print0 |/usr/bin/sort ${SORTARG}|/usr/bin/xargs -0 /bin/cat >|"snippets.concat" | |
+rm -f snippets.concat | |
+/usr/bin/find snippets/ -type f -print0 |/usr/bin/sort ${SORTARG}|/usr/bin/xargs -0 --no-run-if-empty /bin/cat >|"snippets.concat" | |
+if [ ! -e "snippets.concat" ]; then | |
+ echo "No snippets found for ${OUTFILE}" | |
+ exit 1 | |
+fi | |
+ | |
if [ x${TEST} = "x" ]; then | |
# This is a real run, copy the file to outfile | |
/bin/cp snippets.concat ${OUTFILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment