File: .node.sh

package info (click to toggle)
node-jose 4.11.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 4,264 kB
  • sloc: javascript: 16,258; sh: 111; makefile: 4
file content (43 lines) | stat: -rwxr-xr-x 936 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
./node_modules/.bin/esbuild \
  --log-level=warning \
  --format=esm \
  --bundle \
  --platform=node \
  --external:#dist \
  --external:#dist/webapi \
  --target=esnext \
  --outfile=tap/run-node.mjs \
  tap/run-node.ts

source .node_flags.sh

node tap/run-node.mjs '#dist'
NODE_CRYPTO_API=$?

node -e 'process.exit(parseInt(process.versions.node, 10))' &> /dev/null
NODE_VERSION=$?

if [[ "$NODE_VERSION" -le 14 ]]; then
  exit $NODE_CRYPTO_API
fi

node tap/run-node.mjs '#dist/webapi'
WEB_CRYPTO_API=$?

node tap/run-node.mjs '#dist/hybrid'
HYBRID=$?

echo ""
echo "node:crypto"
test $NODE_CRYPTO_API -eq 0 && echo "  passed" || echo "  failed"

echo ""
echo "WebCryptoAPI"
test $WEB_CRYPTO_API -eq 0 && echo "  passed" || echo "  failed"

echo ""
echo "node:crypto with CryptoKey"
test $HYBRID -eq 0 && echo "  passed" || echo "  failed"

test $WEB_CRYPTO_API -eq 0 && test $NODE_CRYPTO_API -eq 0 && test $HYBRID -eq 0