1- #! /usr/bin/env zsh
1+ #! /usr/bin/env bash
22set -euo pipefail
33
4- SCRIPT_PATH=${ ${( % ) :-% N} : A}
5- SCRIPT_DIR=${ SCRIPT_PATH: h}
6- REPO_ROOT=${ SCRIPT_DIR: h}
4+ SCRIPT_PATH=" $( readlink -f " ${BASH_SOURCE[0]} " ) "
5+ SCRIPT_DIR=" $( dirname " $ SCRIPT_PATH" ) "
6+ REPO_ROOT=" $( dirname " $ SCRIPT_DIR" ) "
77
8- WORK_DIR=${REPO_ROOT} /build/_pyret-work
9- OUT_DIR=${REPO_ROOT} /build/pyret
10- PATCH_FILE=${SCRIPT_DIR} /dcic2024-charts.patch
8+ WORK_DIR=" ${REPO_ROOT} /build/_pyret-work"
9+ OUT_DIR=" ${REPO_ROOT} /build/pyret"
10+ PATCH_FILE=" ${SCRIPT_DIR} /dcic2024-charts.patch"
1111
12- PYRET_DIR=${WORK_DIR} /pyret-lang
13- CPO_DIR=${WORK_DIR} /code.pyret.org
12+ PYRET_DIR=" ${WORK_DIR} /pyret-lang"
13+ CPO_DIR=" ${WORK_DIR} /code.pyret.org"
1414
15- PYRET_REPO=https://github.com/ironm00n/pyret-lang.git
16- PYRET_REV=27a74f8dd4bcc762275b487e9d9e90630a25802d
15+ PYRET_REPO=" https://github.com/ironm00n/pyret-lang.git"
16+ PYRET_REV=" 27a74f8dd4bcc762275b487e9d9e90630a25802d"
1717
18- CPO_REPO=https://github.com/ironm00n/code.pyret.org.git
19- CPO_REV=8460d0a97f0aef62f73128ae26ef2fb54f58f6e8
18+ CPO_REPO=" https://github.com/ironm00n/code.pyret.org.git"
19+ CPO_REV=" 8460d0a97f0aef62f73128ae26ef2fb54f58f6e8"
2020
2121clone_at_rev () {
22- local url=$1 rev=$2 dir=$3
23- print -r -- " ==> Cloning ${url} @ ${rev} -> ${dir} "
22+ local url=" $1 " rev=" $2 " dir=" $3 "
23+ printf ' %s\n ' " ==> Cloning ${url} @ ${rev} -> ${dir} "
2424 rm -rf -- " $dir "
2525 git init -q " $dir "
2626 git -C " $dir " remote add origin " $url "
2727 git -C " $dir " fetch --depth 1 origin " $rev "
2828 git -C " $dir " checkout -q FETCH_HEAD
2929}
3030
31- print -r -- " ==> Resetting work/output dirs"
31+ printf ' %s\n ' " ==> Resetting work/output dirs"
3232rm -rf -- " $WORK_DIR " " $OUT_DIR "
3333mkdir -p -- " $WORK_DIR " " $OUT_DIR "
3434
3535clone_at_rev " $PYRET_REPO " " $PYRET_REV " " $PYRET_DIR "
3636clone_at_rev " $CPO_REPO " " $CPO_REV " " $CPO_DIR "
3737
3838if [[ -f " $PATCH_FILE " ]]; then
39- print -r -- " ==> Applying patch to CPO: $PATCH_FILE "
39+ printf ' %s\n ' " ==> Applying patch to CPO: $PATCH_FILE "
4040 git -C " $CPO_DIR " apply " $PATCH_FILE "
4141else
42- print -r -- " ==> Patch not found at $PATCH_FILE (skipping)"
42+ printf ' %s\n ' " ==> Patch not found at $PATCH_FILE (skipping)"
4343fi
4444
45- print -r -- " ==> npm ci (pyret-lang)"
45+ printf ' %s\n ' " ==> npm ci (pyret-lang)"
4646# npm publish (and npm pack) run all lifecycle scripts in "dry-run" mode.
4747# If we don’t override that flag, nested npm command only *pretend* to
4848# install: they print “added ... packages” but write no node_modules tree, so
4949# later steps fail.
5050npm --prefix " $PYRET_DIR " ci --ignore-scripts --dry-run=false
5151
52- print -r -- " ==> npm rebuild (native modules like canvas)"
52+ printf ' %s\n ' " ==> npm rebuild (native modules like canvas)"
5353npm --prefix " $PYRET_DIR " rebuild --dry-run=false
5454
55- print -r -- " ==> make phaseA libA"
55+ printf ' %s\n ' " ==> make phaseA libA"
5656make -C " $PYRET_DIR " -e SHELL=" $( command -v bash) " phaseA libA
5757
5858mkdir -p -- " $PYRET_DIR /build/cpo"
59- print -r -- ' import dcic2024 as _' > " $PYRET_DIR /build/compile-dcic.arr"
59+ printf ' %s\n ' ' import dcic2024 as _' > " $PYRET_DIR /build/compile-dcic.arr"
6060
61- print -r -- " ==> Compile dcic2024 context"
61+ printf ' %s\n ' " ==> Compile dcic2024 context"
6262env -C " $PYRET_DIR " node build/phaseA/pyret.jarr \
6363 -allow-builtin-overrides \
6464 --builtin-js-dir src/js/trove/ \
@@ -71,10 +71,10 @@ env -C "$PYRET_DIR" node build/phaseA/pyret.jarr \
7171 --outfile build/cpo/compile-dcic.jarr \
7272 -no-check-mode
7373
74- print -r -- " ==> Staging -> $OUT_DIR "
74+ printf ' %s\n ' " ==> Staging -> $OUT_DIR "
7575cp -r " $PYRET_DIR /build/phaseA/lib-compiled" " $OUT_DIR /"
7676cp -r " $PYRET_DIR /build/cpo" " $OUT_DIR /"
7777
78- print -r -- " ==> Done."
79- print -r -- " $OUT_DIR /lib-compiled"
80- print -r -- " $OUT_DIR /cpo"
78+ printf ' %s\n ' " ==> Done."
79+ printf ' %s\n ' " $OUT_DIR /lib-compiled"
80+ printf ' %s\n ' " $OUT_DIR /cpo"
0 commit comments