mirror of
https://github.com/dnote/dnote
synced 2026-03-14 22:45:50 +01:00
22 lines
631 B
Bash
Executable file
22 lines
631 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# setup.sh prepares the directory structure and copies static files
|
|
set -eux -o pipefail
|
|
|
|
dir=$(dirname "${BASH_SOURCE[0]}")
|
|
basePath="$dir/../.."
|
|
publicPath=$PUBLIC_PATH
|
|
compiledPath=$COMPILED_PATH
|
|
assetBaseUrl=$ASSET_BASE_URL
|
|
|
|
# prepare directories
|
|
rm -rf "$compiledPath"
|
|
rm -rf "$publicPath"
|
|
mkdir -p "$compiledPath"
|
|
mkdir -p "$publicPath"
|
|
|
|
# copy the assets and artifacts
|
|
cp -r "$basePath"/web/assets/* "$publicPath"
|
|
|
|
# populate placeholders
|
|
assetBaseUrlEscaped=$(echo "$assetBaseUrl" | sed -e 's/[\/&]/\\&/g')
|
|
sed -i -e "s/ASSET_BASE_PLACEHOLDER/$assetBaseUrlEscaped/g" "$publicPath"/static/manifest.json
|