docs.sheetjs.com/tests/cli/denosea.ps1

21 lines
670 B
PowerShell
Raw Normal View History

2026-01-29 04:58:19 +00:00
#!/usr/bin/env pwsh
# https://docs.sheetjs.com/docs/demos/cli/denosea
$oldDir = Get-Location
$tempDir = Join-Path -Path $env:TEMP -ChildPath "sheetjs-cli-deno"
if (Test-Path -Path $tempDir) { Remove-Item -Path $tempDir -Recurse -Force }
New-Item -ItemType Directory -Path $tempDir | Out-Null
Set-Location -Path $tempDir
deno --version
curl -o pres.numbers https://docs.sheetjs.com/pres.numbers
deno run -r --allow-read --allow-import https://docs.sheetjs.com/cli/sheet2csv.ts pres.numbers
deno compile -r --allow-read --allow-import https://docs.sheetjs.com/cli/sheet2csv.ts
./sheet2csv pres.numbers
Set-Location $oldDir
Remove-Item -Path $tempDir -Recurse -Force