UNPKG

739 Bapplication/x-shView Raw
1#!/bin/bash
2# clones tools/assert-internal into here
3scriptdir=$(cd $(dirname $0) && pwd)
4cd $scriptdir
5set -euo pipefail
6src="../assert-internal"
7
8# Don't copy .d.ts and .js files -- otherwise tsc might not recreate
9# those files after we have rewritten the .ts files (probably due to timestamps)
10rsync -av $src/lib/ lib/
11rsync -av $src/test/ test/
12
13majorversion=$(node -p 'require("../../../release.json").majorVersion')
14
15files="README.md LICENSE NOTICE .npmignore jest.ts"
16
17for file in ${files}; do
18 cp $src/$file .
19done
20
21if [[ "$majorversion" = "2" ]]; then
22 echo "Rewriting TS files..."
23 npx rewrite-imports-v2 "**/*.ts"
24
25 # This forces a recompile even if this file already exists
26 rm -f tsconfig.tsbuildinfo
27
28 echo "Done."
29fi