2026-01-22 06:59:11 +00:00
|
|
|
#!/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
|
|
|
|
|
|
2026-06-14 23:29:38 +00:00
|
|
|
perl SheetJSDuk.pl pres.xlsx
|
|
|
|
|
PERL_EXIT=$?
|
2026-01-22 06:59:11 +00:00
|
|
|
|
2026-06-14 23:29:38 +00:00
|
|
|
if [ $PERL_EXIT -ne 0 ] || [ ! -f SheetJSDuk.xlsb ]; then
|
2026-03-09 04:32:12 +00:00
|
|
|
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
|
2026-06-14 23:29:38 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
npx -y xlsx-cli SheetJSDuk.xlsb
|