Skip to content

Commit 790f744

Browse files
committed
ci setup
1 parent d311319 commit 790f744

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ LIBRARY_NAME="${LIBRARY_NAME:-tree-sitter-cedarscript}"
44
TARGET_DIR="target"
55
GRAMMAR_DIR="src/cedarscript_grammar"
66

7-
ts() ( cd "$TARGET_DIR" && tree-sitter-macos-arm64 "$@" ;)
7+
ts() (
8+
cd "$TARGET_DIR" || exit
9+
if [ -n "$GITHUB_ACTIONS" ] || [ "$(uname)" = "Linux" ]; then
10+
# On GitHub Actions or Linux, install and use tree-sitter from npm
11+
if ! command -v tree-sitter &> /dev/null; then
12+
npm install --global tree-sitter-cli
13+
fi
14+
tree-sitter "$@"
15+
return
16+
fi
17+
# Local development on macOS ARM64
18+
tree-sitter-macos-arm64 "$@"
19+
)
820

921
playground() {
1022
while true; do

0 commit comments

Comments
 (0)