build (788B)
1 #!/usr/bin/env bash 2 3 set -eo pipefail 4 5 env=$1 6 7 npm run i18n 8 9 if [ "$env" == "staging" ] 10 then 11 export OUT_DIR="$PWD/out-staging" 12 export NEXT_PUBLIC_PURPLE_API_BASE_URL="https://api-staging.damus.io" 13 else 14 export OUT_DIR="$PWD/out-production" 15 export NEXT_PUBLIC_PURPLE_API_BASE_URL="https://api.damus.io" 16 fi 17 18 npx next build 19 rm -rf "$OUT_DIR" 20 mv out "$OUT_DIR" 21 22 23 # TODO: next doesn't seem to set this up properly. bug? 24 mkdir -p "$OUT_DIR/purple/checkout" 25 mkdir -p "$OUT_DIR/purple/account" 26 mkdir -p "$OUT_DIR/purple/login" 27 ln "$OUT_DIR/purple.html" "$OUT_DIR/purple/index.html" 28 ln "$OUT_DIR/purple/checkout.html" "$OUT_DIR/purple/checkout/index.html" 29 ln "$OUT_DIR/purple/account.html" "$OUT_DIR/purple/account/index.html" 30 ln "$OUT_DIR/purple/login.html" "$OUT_DIR/purple/login/index.html"