blob: 80213d99b06f36debc52de3b5501ac870e800a0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/usr/bin/env bash
# Syntax-check a Claude Code workflow script. Workflow bodies are not plain
# ESM (top-level `return` is legal because the runtime wraps them), so wrap
# in an async arrow that declares the runtime globals before parsing.
set -euo pipefail
f="${1:?usage: check.sh <workflow.js>}"
tmp="$(mktemp --suffix=.mjs)"
trap 'rm -f "$tmp"' EXIT
{
echo '(async (args, agent, pipeline, parallel, phase, log, workflow, budget) => {'
sed 's/^export //' "$f"
echo '})'
} > "$tmp"
node --check "$tmp" && echo "OK: $f"
|