Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 2.68 KB

File metadata and controls

49 lines (41 loc) · 2.68 KB

← Back to Backlog

[SC-006] ✅ DONE - Scoop Update Helper Script

Status: Done (2026-03-18) Priority: Low Component: lib/scoop/scoop.ps1 (new), lib/scoop/scoop.Tests.ps1 (new), tools/scoop/update-scoop.ps1 (new), tools/scoop/update-scoop.bat (new)

Description: Interactive helper script to update installed Scoop packages. Launched via Keypirinha or FlowLauncher (.bat wrapper). Refreshes Scoop and bucket info first, then shows a numbered list of updatable apps. User can select one, several (comma-separated), or all apps to update.

All logic lives in lib/scoop/scoop.ps1 (dot-sourced library). tools/scoop/update-scoop.ps1 is a thin wrapper that sources the library and calls the entry point (following the wsl-manager pattern).

Behavior:

  1. Run scoop update (refresh Scoop itself + bucket info)
  2. Run scoop status to get list of updatable apps
  3. If no updates available, display message and exit
  4. Display numbered list of updatable apps with current and latest versions
  5. Prompt: enter number(s) comma-separated, or A for all
  6. Update selected app(s) via scoop update <name>

Implementation (follows tools/wsl-manager/ pattern):

  • Library functions in lib/scoop/scoop.ps1 (dot-sourced, no Set-StrictMode)
  • Sources lib/utils/utils.ps1 for Invoke-CommandLine, Write-Status, etc.
  • Thin wrapper in tools/scoop/update-scoop.ps1 with Set-StrictMode
  • .bat wrapper for launcher integration
  • CI/test environment awareness via Test-RunningInCIorTestEnvironment

Acceptance Criteria:

  • lib/scoop/scoop.ps1 created with all functions
  • lib/scoop/scoop.Tests.ps1 created with unit tests
  • tools/scoop/update-scoop.ps1 created as thin wrapper
  • .bat wrapper created for Keypirinha/FlowLauncher launch
  • Runs scoop update to refresh Scoop before checking status
  • Runs scoop status and parses output to list updatable apps
  • Shows numbered list with app name, current version, and latest version
  • User can enter A to update all apps
  • User can enter comma-separated numbers to update specific apps
  • User can enter a single number to update one app
  • Uses Invoke-CommandLine for all external commands
  • Clear status/success/error output using Write-Status / Write-Success / Write-ErrorMsg
  • CI/test environment awareness
  • All existing tests continue to pass
  • Fix Get-ScoopUpdatableApp to handle PSCustomObject output from modern scoop (PS 7.x)
  • Fix PSAvoidUsingWriteHost linting failure in update-scoop.ps1
  • Add unit test for PSCustomObject parsing path
  • Add sanity check in integration test to catch vacuous passes

← Back to Backlog