File tree Expand file tree Collapse file tree 4 files changed +54
-3
lines changed Expand file tree Collapse file tree 4 files changed +54
-3
lines changed Original file line number Diff line number Diff line change 33 branches : main
44 paths :
55 - installer.sh
6+ - installer.ps1
67 - .github/workflows/cd.installer.yml
78
89jobs :
@@ -32,14 +33,21 @@ jobs:
3233
3334 - run :
3435 aws s3 cp
35- ./installer.sh s3://www.pkgx.sh/installer.sh
36+ ./installer.sh
37+ s3://www.pkgx.sh/installer.sh
38+ --metadata-directive REPLACE
39+ --cache-control no-cache,must-revalidate
40+ - run :
41+ aws s3 cp
42+ ./installer.ps1
43+ s3://www.pkgx.sh/installer.sh
3644 --metadata-directive REPLACE
3745 --cache-control no-cache,must-revalidate
3846
3947 - run :
4048 aws cloudfront create-invalidation
4149 --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }}
42- --paths / /installer.sh
50+ --paths / /installer.sh /installer.ps1
4351
4452 - name : Seal Deployment
4553 uses : bobheadxi/deployments@v1
Original file line number Diff line number Diff line change 2929 shellcheck :
3030 runs-on : ubuntu-latest
3131 steps :
32- - uses : actions/checkout@v4
32+ - uses : actions/checkout@v4
3333 - uses : reviewdog/action-shellcheck@v1
3434
3535 usage-as-proxy :
@@ -182,6 +182,15 @@ jobs:
182182
183183 - run : pkgx deno eval 'console.log(1)'
184184
185+ windows :
186+ runs-on : windows-latest
187+ steps :
188+ - uses : actions/checkout@v4
189+ - run : .\\installer.ps1
190+ - run : |
191+ $env:Path += ";C:\Program Files\pkgx"
192+ pkgx +zlib.net
193+
185194 upgrades :
186195 runs-on : ubuntu-latest
187196 steps :
Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ $ curl https://pkgx.sh | sh
6262# - if both are already installed, does an update check
6363```
6464
65+ Or on Windows:
66+
67+ ``` ps1
68+ $ irm https://pkgx.sh | iex
69+ # - installs `pkgx.exe` to `$env:ProgramFiles/pkgx`
70+ # - adds it to your system PATH
71+ ```
72+
6573## Temporary Sandboxes
6674
6775To use ` pkgx ` to run a command in a temporary sandbox:
Original file line number Diff line number Diff line change 1+ # irm https://pkgx.sh | iex
2+
3+ $ErrorActionPreference = " Stop"
4+
5+ # Determine install location
6+ $installDir = " $env: ProgramFiles \pkgx"
7+
8+ # Create directory if it doesn't exist
9+ if (! (Test-Path $installDir )) {
10+ New-Item - ItemType Directory - Path $installDir - Force | Out-Null
11+ }
12+
13+ # Download and extract
14+ $zipUrl = " https://pkgx.sh/Windows/x86_64.zip"
15+ $zipFile = " $env: TEMP \pkgx.zip"
16+ Invoke-WebRequest - Uri $zipUrl - OutFile $zipFile
17+ Expand-Archive - Path $zipFile - DestinationPath $installDir - Force
18+ Remove-Item $zipFile
19+
20+ # Ensure PATH is updated
21+ $envPath = [System.Environment ]::GetEnvironmentVariable(" Path" , [System.EnvironmentVariableTarget ]::Machine)
22+ if ($envPath -notlike " *$installDir *" ) {
23+ [System.Environment ]::SetEnvironmentVariable(" Path" , " $envPath ;$installDir " , [System.EnvironmentVariableTarget ]::Machine)
24+ }
25+
26+ Write-Host " pkgx installed successfully! Restart your terminal to use it."
You can’t perform that action at this time.
0 commit comments