Skip to content

Commit 95d4162

Browse files
authored
Merge pull request #407 from gnh1201/dev
Add the one-click bootstrap
2 parents 7bc8a56 + 1530c8b commit 95d4162

2 files changed

Lines changed: 26 additions & 14 deletions

File tree

app/assets/js/core-js-3.49.0.wsh.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,7 @@ var NullProtoObjectViaSc64bit = function () {
24252425
return {};
24262426
};
24272427
}
2428-
}
2428+
};
24292429

24302430
// Create object with fake `null` prototype: use iframe Object with cleared prototype
24312431
var NullProtoObjectViaIFrame = function () {

bootstrap.ps1

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@
77
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex
88
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex -dev main
99
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex -dev dev
10+
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex main
1011
#
1112
# Central default branch configuration for this install script.
1213
# Update this value if the repository's default branch changes.
13-
$DefaultBranch = "master"
14-
15-
param(
16-
# Branch to install from; defaults to the repository's configured primary branch.
17-
[string]$dev = $DefaultBranch
18-
)
14+
$defaultBranch = "master"
1915

2016
$ErrorActionPreference = "Stop"
2117

@@ -32,6 +28,27 @@ function Write-Err($msg) {
3228
}
3329

3430
try {
31+
# Step 0: Parse arguments (iex-compatible)
32+
# Supports:
33+
# iex -dev main
34+
# iex main
35+
# iex
36+
$branch = $defaultBranch
37+
38+
for ($i = 0; $i -lt $args.Count; $i++) {
39+
$arg = $args[$i]
40+
41+
if ($arg -eq "-dev" -and ($i + 1) -lt $args.Count) {
42+
$branch = $args[$i + 1]
43+
break
44+
}
45+
elseif ($arg -notmatch "^-") {
46+
$branch = $arg
47+
}
48+
}
49+
50+
Write-Step "Using branch: $branch"
51+
3552
# Step 1: Create a temporary working directory using a UUID
3653
Write-Step "Creating temporary workspace..."
3754

@@ -45,12 +62,7 @@ try {
4562
$repo = "gnh1201/welsonjs"
4663
$zipPath = Join-Path $tempDir "package.zip"
4764

48-
# Step 2: Determine branch (default: master)
49-
$branch = $dev
50-
51-
Write-Step "Using branch: $branch"
52-
53-
# GitHub branch ZIP URL
65+
# Step 2: Build download URL
5466
$downloadUrl = "https://github.com/$repo/archive/refs/heads/$branch.zip"
5567

5668
Write-Ok "Download URL: $downloadUrl"
@@ -102,4 +114,4 @@ try {
102114
catch {
103115
Write-Err $_
104116
exit 1
105-
}
117+
}

0 commit comments

Comments
 (0)