From ea0ac7c9bceecdbdd52f697e0109312b1a6cbb48 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Wed, 30 Oct 2024 20:32:22 +0000 Subject: [PATCH] typescript: add build script to post-process --- apps/clkinfostopw/clkinfo.js | 2 +- typescript/build.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 typescript/build.sh diff --git a/apps/clkinfostopw/clkinfo.js b/apps/clkinfostopw/clkinfo.js index caf460da33..8b7a6a9adf 100644 --- a/apps/clkinfostopw/clkinfo.js +++ b/apps/clkinfostopw/clkinfo.js @@ -74,4 +74,4 @@ } ] }; -}); // FIXME: semi-colon added automatically when Typescript generates Javascript file? +}) diff --git a/typescript/build.sh b/typescript/build.sh new file mode 100755 index 0000000000..4c414a199e --- /dev/null +++ b/typescript/build.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +usage(){ + echo >&2 "Usage: $0" + exit 2 +} + +if test $# -ne 0 +then usage +fi + +cd "$(dirname "$0")" + +npm run build + +find ../apps -iname '*.ts' | + sed 's/\.ts$/.js/' | + grep -E 'clkinfo|setting' | + xargs sed -i '' '$s/;$//'