dyna3/tools/package-for-deployment.bash

17 lines
504 B
Bash
Raw Normal View History

# set paths. this technique for getting the script location comes from
# `mklement0` on Stack Overflow
#
# https://stackoverflow.com/a/24114056
#
tools=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
src="$tools/../app-proto/dist"
dest="$tools/../deploy/dyna3"
# remove the old hash-named files
[ -e "$dest"/dyna3-*.js ] && rm "$dest"/dyna3-*.js
[ -e "$dest"/dyna3-*.wasm ] && rm "$dest"/dyna3-*.wasm
[ -e "$dest"/main-*.css ] && rm "$dest"/main-*.css
# copy the distribution
cp -r "$src/." "$dest"