docs.sheetjs.com/tests/cli/nexe.sh
2026-01-28 23:58:19 -05:00

29 lines
723 B
Bash
Executable File

#!/bin/bash
# https://docs.sheetjs.com/docs/demos/cli/nexe
cd /tmp
rm -rf sheetjs-nexe
mkdir sheetjs-nexe
cd sheetjs-nexe
curl -o pres.numbers https://docs.sheetjs.com/pres.numbers
curl -o xlsx-cli.js https://docs.sheetjs.com/cli/xlsx-cli.js
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz exit-on-epipe commander@2
OS="$(uname -s)"
ARCH="$(uname -m)"
case "$OS" in
Darwin) OS="macos" ;;
Linux) OS="linux" ;;
*) echo "unsupported OS: $OS"; exit 1 ;;
esac
case "$ARCH" in
x86_64) npx -y nexe -t 14.15.3 xlsx-cli.js ;;
arm64|aarch64) npx -y nexe xlsx-cli.js --build --python=$(which python3) --make="-j8" ;;
*) echo "unsupported architecture: $ARCH"; exit 1 ;;
esac
./xlsx-cli pres.numbers