docs.sheetjs.com/tests/engines/duktape-perl.sh
2026-06-15 11:13:04 -04:00

31 lines
686 B
Bash
Executable File

#!/bin/bash
# https://docs.sheetjs.com/docs/demos/engines/duktape#perl-demo
cd /tmp
rm -rf sheetjs-duk-perl
mkdir sheetjs-duk-perl
cd sheetjs-duk-perl
curl -LO https://docs.sheetjs.com/duk/SheetJSDuk.pl
curl -LO https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/xlsx.extendscript.js
curl -LO https://docs.sheetjs.com/pres.xlsx
perl SheetJSDuk.pl pres.xlsx
PERL_EXIT=$?
if [ $PERL_EXIT -ne 0 ] || [ ! -f SheetJSDuk.xlsb ]; then
cat <<EOF
If the script failed with an error about XS, install dependencies:
$ cpan install JavaScript::Duktape::XS
This command may need to be run as root:
$ sudo cpan install JavaScript::Duktape::XS
EOF
exit 1
fi
npx -y xlsx-cli SheetJSDuk.xlsb