Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions install.ps1 → bootstrap.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# WelsonJS One-Click Installer (install.ps1)
# WelsonJS One-Click Bootstrap (bootstrap.ps1)
# Copyright 2019-2025, Namhyeon Go <gnh1201@catswords.re.kr> and the WelsonJS contributors.
# SPDX-License-Identifier: GPL-3.0-or-later
# https://github.com/gnh1201/welsonjs
#
# Usage:
# irm https://welson.js.org/install.ps1 | iex
# irm https://welson.js.org/install.ps1 | iex -dev main
# irm https://welson.js.org/install.ps1 | iex -dev dev
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex -dev main
# irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex -dev dev
Comment on lines +8 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Broken -dev invocation 🐞 Bug ≡ Correctness

The updated usage examples pipe the script into iex -dev ..., but -dev is parsed as a parameter
to Invoke-Expression (which doesn’t accept it), so the command errors before bootstrap.ps1
executes and users cannot select a branch.
Agent Prompt
### Issue description
`bootstrap.ps1` documents `irm <url> | iex -dev main` / `... -dev dev`, but `-dev` is not a valid parameter for `Invoke-Expression`, so the command fails before the downloaded script text executes.

### Issue Context
The script defines a `param([string]$dev = $DefaultBranch)` parameter and does not use `$args`, so callers must invoke the downloaded content as a ScriptBlock and pass `-dev` to that ScriptBlock.

### Fix
Update the header usage examples to a working invocation pattern, e.g.:
```powershell
# default
irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1 | iex

# with branch selection
& ([ScriptBlock]::Create((irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1))) -dev main
& ([ScriptBlock]::Create((irm https://catswords.blob.core.windows.net/welsonjs/bootstrap.ps1))) -dev dev
```
(Using `Invoke-RestMethod` explicitly instead of `irm` is also fine.)

### Fix Focus Areas
- bootstrap.ps1[6-18]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

#
# Central default branch configuration for this install script.
# Update this value if the repository's default branch changes.
Expand Down
Loading