Skip to content
This repository was archived by the owner on Oct 25, 2025. It is now read-only.

Commit 0c1ce2d

Browse files
committed
use bash for script
1 parent 67e5a73 commit 0c1ce2d

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"build_typescript": "swc bin -d dist",
1919
"build_pawtograder": "npm run build_pawtograder:pyret && npm run build_pawtograder:prepare",
2020
"build_pawtograder:pyret": "npx --no pyret -- --builtin-js-dir node_modules/pyret-lang/src/js/trove/ -p src/pawtograder.arr -o src/pawtograder.cjs -ck",
21-
"build_pawtograder:prepare": "./scripts/prepare.zsh",
21+
"build_pawtograder:prepare": "./scripts/prepare.sh",
2222
"prepack": "npm run build"
2323
},
2424
"dependencies": {
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
#!/usr/bin/env zsh
1+
#!/usr/bin/env bash
22
set -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

2121
clone_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"
3232
rm -rf -- "$WORK_DIR" "$OUT_DIR"
3333
mkdir -p -- "$WORK_DIR" "$OUT_DIR"
3434

3535
clone_at_rev "$PYRET_REPO" "$PYRET_REV" "$PYRET_DIR"
3636
clone_at_rev "$CPO_REPO" "$CPO_REV" "$CPO_DIR"
3737

3838
if [[ -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"
4141
else
42-
print -r -- "==> Patch not found at $PATCH_FILE (skipping)"
42+
printf '%s\n' "==> Patch not found at $PATCH_FILE (skipping)"
4343
fi
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.
5050
npm --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)"
5353
npm --prefix "$PYRET_DIR" rebuild --dry-run=false
5454

55-
print -r -- "==> make phaseA libA"
55+
printf '%s\n' "==> make phaseA libA"
5656
make -C "$PYRET_DIR" -e SHELL="$(command -v bash)" phaseA libA
5757

5858
mkdir -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"
6262
env -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"
7575
cp -r "$PYRET_DIR/build/phaseA/lib-compiled" "$OUT_DIR/"
7676
cp -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

Comments
 (0)