/ concept-collection / numbl-web-ide
Sign in
concept-collection / numbl-web-ide
numbl-web-ide / scripts / generate-builtins.sh
18 lines · 679 BCodeBlameHistory
ecdc868numbl web IDE: run .m files in the browser with numblJeremy Magland 1#!/usr/bin/env bash
2# Regenerates src/numbl/builtinNames.ts from the installed numbl package's
3# builtin registry (used only for editor syntax highlighting). Re-run after
4# upgrading the numbl dependency.
5set -euo pipefail
7ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
8OUT="$ROOT/src/numbl/builtinNames.ts"
11 echo "// Generated by scripts/generate-builtins.sh — do not edit."
12 echo "// Builtin function names of the installed numbl version, for syntax highlighting."
13 echo "export const numblBuiltinNames: string[] = ["
14 (cd "$ROOT" && npx numbl list-builtins) | sed "s/^/\t'/; s/$/',/"
15 echo "];"
16} > "$OUT"
18echo "wrote $OUT ($(grep -c "'," "$OUT") names)"
moveopenescclose