refactor!: guard install flow against dot-sourcing - #136
Conversation
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
5e49b3c to
a26a560
Compare
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. Summary by CodeRabbit
WalkthroughChangesThe installer checks prerequisites before parameter validation and temporarily uses terminating errors during direct execution. Tests assign Scoop paths directly from ChangesInstaller behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: eaa45aa4-9822-49df-8ad6-60492464dcd3
📒 Files selected for processing (2)
install.ps1test/install.Tests.ps1
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
…ession ScoopInstaller/Install#136 (2026-08-27) made install.ps1 skip the install flow when it is dot-sourced: the script now only calls Install-Scoop when $MyInvocation.InvocationName is not '.'. GitHub Actions runs a pwsh step by dot-sourcing the step script, so `irm get.scoop.sh | iex` inherits that invocation name, defines the functions and exits without installing. The next step then fails on `scoop config` within a second. Every Preview Build and release build in this repository has failed that way on the windows-11-arm job since 09:48 UTC. Download the installer to a file and run it with the call operator, whose invocation name is the file path, and fail the step if scoop.ps1 is not in the shims directory afterwards.
This COULD be a BREAKING CHANGE, as the behavior has changed.
This PR adjusts the execution prerequisites for the installer's core install flow. When the installer is imported via dot-sourcing (i.e.,
. .\install.ps1), the install flow will no longer run. This aligns with the intended behavior and distinguishes between simply importing functions defined in the installer via dot-sourcing, and directly executing the installer.This change was prompted by a CI error in #135, tests should not execute the install flow.