Skip to content

chore: make warn use 'scoop update --- to install a new version. for `scoo…#6636

Open
scil wants to merge 1 commit intoScoopInstaller:masterfrom
scil:patch-1
Open

chore: make warn use 'scoop update --- to install a new version. for `scoo…#6636
scil wants to merge 1 commit intoScoopInstaller:masterfrom
scil:patch-1

Conversation

@scil
Copy link
Copy Markdown

@scil scil commented Apr 7, 2026

make wan for scoop install more friendly to users

Description

add scoop update --- to a new line, make it easy to be copied

Motivation and Context

when user have installed an app but still run scoop install, the user will get warn about scoop udpate.
it's good to put the command in a dedicated line, which is easy to be copied

example

> scoop install brave-beta
WARN  'brave-beta' (1.86.101) is already installed.
Use 'scoop update brave-beta' to install a new version.
        scoop update brave-beta

How Has This Been Tested?

test is simple because only warn info changed
tested on my pc

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

Summary by CodeRabbit

  • Bug Fixes
    • Updated installation warning messages to provide additional command suggestions when packages are already installed.

…p install` more friendly to users

add `scoop update ---` to a new line, make it easy to be copyed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Walkthrough

Updated 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

Cohort / File(s) Summary
Already Installed Warnings
libexec/scoop-install.ps1
Updated "already installed" warning messages to append "tscoop update ..." suggestion after existing "scoop update ..." guidance; corrected version variable reference to use $curVersion in version-specific handling block.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With warnings now twice as wise and bright,
Our install script guides users right,
Both scoop and tscoop, hand in hand,
Together they help updates expand! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is truncated and incomplete ('chore: make warn use 'scoop update --- to install a new version.' for scoo...'), making it unclear and failing to convey the actual change about improving the warning message formatting. Complete the title to clearly describe the change, such as: 'chore: improve scoop install warning message formatting for better usability'
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between b588a06 and b2bd1af.

📒 Files selected for processing (1)
  • libexec/scoop-install.ps1

Comment thread libexec/scoop-install.ps1
Comment on lines 103 to 105
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant