Change Bash directive style
All checks were successful
/ build (push) Successful in 50s
/ build (pull_request) Successful in 41s

Oops, it wasn't that it wasn't finding the file, it was that the first line failed.
This commit is contained in:
Michael Bradley 2025-02-19 18:43:25 -05:00
parent 66756b0605
commit 8d180285a9
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
2 changed files with 2 additions and 2 deletions

25
render.bash Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
yarn "build:targets"
PROD='dist/prod'
if [[ -d "$PROD" ]]; then
rm -r "$PROD"
fi
mkdir -p "$PROD"
echo 'Rendering webpage...'
node -e 'import("./dist/server/entry-server.js").then(({render}) => console.log(render().html))' > "$PROD"/index.html
echo "Preparing $PROD..."
# Copy used assets
cp -r dist/client/assets "$PROD"/
cp public/* "$PROD"/
# Not needed: Pre-rendered
rm "$PROD"/assets/*.js
# Not needed: Inlined
rm "$PROD"/assets/*.css