mylloon.fr/run.sh
Mylloon 36ca74943a
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending
ci/woodpecker/pr/publish Pipeline is pending
verbose
2023-04-09 18:03:03 +02:00

32 lines
772 B
Bash
Executable file

#!/usr/bin/env bash
set -o errexit # crash the script when a command crash
set -o pipefail # same as above for piped command
set -o nounset # crash when a variable doesnt exist
# TRACE=1 for debug
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
cd "$(dirname "$0")" # change script directory
main() {
dir_dist="./dist"
dir_template="/templates"
if [ ! -d "$dir_dist$dir_template" ]; then
echo "Copy template to dist directory"
mkdir -p "$dir_dist$dir_template"
cp -r ".$dir_template" "$dir_dist"
echo "Generate minified templates"
cargo run --release -- --no-http
fi
echo "Run the app" \
"(in case of minification issue, run 'rm -r dist/ target/')"
cargo run --release
}
main "$@"