...
This commit is contained in:
27
start.sh
27
start.sh
@@ -1,25 +1,10 @@
|
||||
# builds if executable isn't foound
|
||||
if [[ ! -f "tailwindcss" ]]
|
||||
then
|
||||
sh build.sh
|
||||
fi
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# initialized and configures tailwind if not configured
|
||||
if [[ ! -f "tailwind.config.js" ]]
|
||||
then
|
||||
./tailwindcss init
|
||||
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
|
||||
fi
|
||||
export BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "${BASE}"
|
||||
|
||||
# compiles tailwind css & launches locally
|
||||
rm -rf public static/css
|
||||
./tailwindcss -i css/index.css -o ./static/css/index.css --watch & zola serve &
|
||||
|
||||
# compiles tailwind css for prod & builds project
|
||||
./tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
||||
zola build
|
||||
|
||||
# kills zola and tw bg processes on interrupt
|
||||
trap 'kill $(jobs -p); exit 1' INT
|
||||
wait
|
||||
source env.sh
|
||||
|
||||
zola serve
|
||||
Reference in New Issue
Block a user