lowtechweb/run

35 lines
1005 B
Bash
Executable File

#!/bin/bash
# -e Exit immediately if a command exits with a non-zero status.
# -u Treat unset variables as an error when substituting.
set -eu
START=`date +%s`
echo
echo "┌┐░░░░░░┌──┐░░┌┐░┌┬─┬┐░┌┐░"
echo "││┌─┬┬┬┐└┐┌┴┬─┤└┐││││├─┤└┐"
echo "│└┤┼││││░││┴┤─┤│││││││┴┤┼│"
echo "└─┴─┴──┘░└┴─┴─┴┴┘└─┴─┴─┴─┘"
echo
if [ $# -ge 1 ]; then
if [ $1 == "dev" ]; then
hugo server -D
elif [ $1 == "install" ]; then
echo "- Initialisation de git submodule"
git submodule init
echo "- Installe les dépendances node"
nvm use
cd themes/hugo-theme-lowtech && npm i
fi
else
echo "Commands:"
echo "- ./run install : Installe les dépendances"
echo "- ./run dev : Lance hugo pour le développement avec l'autoreload"
echo
fi
END=`date +%s`
echo "✨ Done in $((END-START))s"