docs.sheetjs.com/tests/cli/pkg.sh

31 lines
725 B
Bash
Raw Normal View History

2024-05-29 05:10:39 +00:00
#!/bin/bash
# https://docs.sheetjs.com/docs/demos/cli/pkg
cd /tmp
rm -rf sheetjs-pkg
mkdir sheetjs-pkg
cd sheetjs-pkg
curl -o pres.numbers https://docs.sheetjs.com/pres.numbers
curl -o xlsx-cli.js https://docs.sheetjs.com/cli/xlsx-cli.js
2024-07-18 22:19:02 +00:00
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz exit-on-epipe commander@2
2024-05-29 05:10:39 +00:00
2026-01-22 06:59:11 +00:00
OS="$(uname -s)"
ARCH="$(uname -m)"
2024-05-29 05:10:39 +00:00
2026-01-22 06:59:11 +00:00
case "$OS" in
Darwin) OS="macos" ;;
Linux) OS="linux" ;;
*) echo "unsupported OS: $OS"; exit 1 ;;
esac
2024-05-29 05:10:39 +00:00
2026-01-22 06:59:11 +00:00
case "$ARCH" in
x86_64) ARCH="x64" ;;
arm64|aarch64) ARCH="arm64" ;;
*) echo "unsupported arch: $ARCH"; exit 1 ;;
esac
npx -y pkg -t "node18-win-${ARCH},node18-linux-${ARCH},node18-macos-${ARCH}" xlsx-cli.js
./xlsx-cli-${OS} pres.numbers