bad commit

This commit is contained in:
raspbeguy 2020-05-13 14:46:06 +02:00
parent da37523245
commit ceee7e85f9
3 changed files with 40 additions and 1 deletions

29
test/check_assets.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
if [ -f config.sh ]; then
. config.sh
fi
if [ -z "$POSTS_DIR" ]
then
echo "POSTS_DIR environment variable is unset." > /dev/stderr
exit 2
fi
if [ -z "$ASSETS_DIR" ]
then
echo "ASSETS_DIR environment variable is unset." > /dev/stderr
exit 2
fi
rc=0
sed -rn 's|^.*\!\[.*\]\(%assets_url%/(.*)\)$|\1|p' $POSTS_DIR/* | while read line
do
if [ ! -f "$ASSETS_DIR/$line" ]
then
echo "$line not found"
rc=1
fi
done
exit $rc

2
test/config.sh Normal file
View File

@ -0,0 +1,2 @@
POSTS_DIR="../content/posts"
ASSETS_DIR="../assets"

View File

@ -1,6 +1,14 @@
#!/bin/bash
POSTS_DIR="content/posts"
if [ -f config.sh ]; then
. config.sh
fi
if [ -z "$POSTS_DIR" ]
then
echo "POSTS_DIR environment variable is unset." > /dev/stderr
exit 2
fi
cd $POSTS_DIR
for post in *