roc/www/build-dev-local.sh
2024-01-03 14:24:31 +01:00

26 lines
691 B
Bash
Executable File

#!/usr/bin/env bash
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -euxo pipefail
# Use this script to for testing the WIP site locally without downloading assets every time.
# NOTE run `bash www/build.sh` to cache local copy of fonts, and repl assets etc
## Get the directory of the currently executing script
DIR="$(dirname "$0")"
# Change to that directory
cd "$DIR" || exit
rm -rf dist/
cp -r build dist/
cp -r public/* dist/
roc run main.roc -- content/ dist/
echo "Adding github link to examples..."
source scripts/add-github-link-to-examples.sh
add_github_link_to_examples dist/examples
simple-http-server -p 8080 --nocache --cors --index -- dist/