chore: make warn use 'scoop update --- to install a new version. for `scoo…#6636
chore: make warn use 'scoop update --- to install a new version. for `scoo…#6636scil wants to merge 1 commit intoScoopInstaller:masterfrom
use 'scoop update --- to install a new version. for `scoo…#6636Conversation
…p install` more friendly to users add `scoop update ---` to a new line, make it easy to be copyed
WalkthroughUpdated warning messages in the Scoop install script to include an additional "tscoop update" command suggestion alongside existing "scoop update" guidance when packages are already installed. The changes affect version-specific and single-app installation paths, incorporating the current version variable reference. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@libexec/scoop-install.ps1`:
- Around line 103-105: The warning uses the stale variable $curVersion inside
the loop; update the warn call in the installed_manifest check to use the parsed
$version variable instead of $curVersion (replace both occurrences of
$curVersion in the message with $version) so the "scoop install app@version"
specific-version warning shows the correct version; locate this in the
installed_manifest $app $version conditional and modify the warn invocation
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d48d4421-3ed9-464a-9ede-fbea8c08bf72
📒 Files selected for processing (1)
libexec/scoop-install.ps1
| if (installed_manifest $app $version) { | ||
| warn "'$app' ($version) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version." | ||
| warn "'$app' ($curVersion) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version.`n`tscoop update $app$(if ($global) { ' --global' })" | ||
| continue |
There was a problem hiding this comment.
Use $version in the specific-version warning.
$curVersion comes from the earlier single-app precheck, so in this loop it can be empty or stale. That makes the scoop install app@version warning print () or the wrong version. Use the parsed $version here instead.
🐛 Proposed fix
- warn "'$app' ($curVersion) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version.`n`tscoop update $app$(if ($global) { ' --global' })"
+ warn "'$app' ($version) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version.`n`tscoop update $app$(if ($global) { ' --global' })"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (installed_manifest $app $version) { | |
| warn "'$app' ($version) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version." | |
| warn "'$app' ($curVersion) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version.`n`tscoop update $app$(if ($global) { ' --global' })" | |
| continue | |
| if (installed_manifest $app $version) { | |
| warn "'$app' ($version) is already installed.`nUse 'scoop update $app$(if ($global) { ' --global' })' to install a new version.`n`tscoop update $app$(if ($global) { ' --global' })" | |
| continue |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@libexec/scoop-install.ps1` around lines 103 - 105, The warning uses the stale
variable $curVersion inside the loop; update the warn call in the
installed_manifest check to use the parsed $version variable instead of
$curVersion (replace both occurrences of $curVersion in the message with
$version) so the "scoop install app@version" specific-version warning shows the
correct version; locate this in the installed_manifest $app $version conditional
and modify the warn invocation accordingly.
make wan for
scoop installmore friendly to usersDescription
add
scoop update ---to a new line, make it easy to be copiedMotivation and Context
when user have installed an app but still run
scoop install, the user will get warn aboutscoop udpate.it's good to put the command in a dedicated line, which is easy to be copied
example
How Has This Been Tested?
test is simple because only warn info changed
tested on my pc
Checklist:
developbranch.Summary by CodeRabbit