Upgrade to Node v16 for Github workflows.
[ustaxlib.git] / build.sh
1 #!/bin/sh
2 # Copyright 2020 Blue Static <https://www.bluestatic.org>
3 # This program is free software licensed under the GNU General Public License,
4 # version 3.0. The full text of the license can be found in LICENSE.txt.
5 # SPDX-License-Identifier: GPL-3.0-only
6
7 OUTDIR=./dist
8
9 set -ex
10
11 # Clean.
12 rm -rf $OUTDIR
13
14 # Compile.
15 npx tsc --version
16 npx tsc
17
18 # Drop tests from the compiled output.
19 find $OUTDIR -type f -name '*.test.*' -exec rm {} +
20
21 cp -r examples $OUTDIR
22 cp README.md $OUTDIR
23 cp LICENSE.txt $OUTDIR
24
25 # "Preprocess" the dist package.json.
26 cp ./package.json $OUTDIR
27 sed -i.bak -e s@\"dist/@\"@ $OUTDIR/package.json
28 rm $OUTDIR/package.json.bak