Don't diff files that don't exist

This commit is contained in:
Ian Gulliver
2019-04-21 18:14:05 +00:00
parent 5507429fc1
commit f28ae869e9

View File

@@ -15,7 +15,9 @@ for FILE in $BASEDIR/*.md; do
echo "$BASENAME -> $OUTNAME"
TEMP=$(tempfile --dir=$BASEDIR --mode=0644 --suffix=.tmp)
markdown $FILE > $TEMP
diff -ud --color=always $OUTPATH $TEMP || true
if [[ -e $OUTPATH ]]; then
diff -ud --color=always $OUTPATH $TEMP || true
fi
mv $TEMP $OUTPATH
done