disseminate/scripts/docker_run.sh
hexlocation's laptop (asiago) 57016f4f3f doing stuff l8r
2024-03-29 09:15:24 -04:00

40 lines
927 B
Bash
Executable file

# I'm so bad at bash scripting
cat << EOF
____ ______________ __
/ __ \/ _/ ___/ ___// /
/ / / // / \__ \\__ \/ /
/ /_/ // / ___/ /__/ /_/
/_____/___//____/____(_)
EOF
if [ ! -d data ]; then
echo '-------------'
echo 'Data folder not found. Did you set up a volume?'
echo '-------------'
exit 1
fi
if [ ! -f data/config.json ]; then
echo '-------------'
echo 'Config file not found. Please create one.'
echo '-------------'
exit 1
fi
if [ -z "$(find posts -mindepth 1 -maxdepth 1)" ]; then
echo '-------------'
echo 'Posts directory is empty, copying default...'
echo '-------------'
cp -r default_posts/* data/posts
fi
if [ -z "$(find templates -mindepth 1 -maxdepth 1)" ]; then
echo '-------------'
echo 'Template directory is empty, copying default...'
echo '-------------'
cp -r default_templates/* data/templates
fi
echo 'Starting...'
node index.js
echo 'Exiting...'