Skip to content

Conversation

@z-Fng
Copy link
Member

@z-Fng z-Fng commented Nov 8, 2025

Description

This PR makes the following changes:

  • fix(core): Skip NO_JUNCTION logic when $app is 'scoop' in currentdir function.

Motivation and Context

When I set NO_JUNCTION to true, I noticed that scoop prefix scoop returns an incorrect path.

This causes scripts under bucket\bin, such as checkver.ps1, to stop working.

if(!$env:SCOOP_HOME) { $env:SCOOP_HOME = Resolve-Path (scoop prefix scoop) }
$checkver = "$env:SCOOP_HOME/bin/checkver.ps1"
$dir = "$PSScriptRoot/../bucket" # checks the parent dir
Invoke-Expression -command "& '$checkver' -dir '$dir' $($args | ForEach-Object { "$_ " })"
image image

Related PRs/Issues

How Has This Been Tested?

image

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
    • Adjusted version selection so the 'scoop' application no longer uses the non-junction "current" handling, ensuring consistent current-version behavior for scoop-managed packages.

@coderabbitai
Copy link

coderabbitai bot commented Nov 8, 2025

Walkthrough

currentdir in lib/core.ps1 now skips NO_JUNCTION handling when the app name is 'scoop'. If NO_JUNCTION is set and app != 'scoop', previous NO_JUNCTION behavior applies; otherwise the code falls back to the 'current' path. CHANGELOG.md updated accordingly.

Changes

Cohort / File(s) Summary
Core logic change
lib/core.ps1
Added an extra check in currentdir so NO_JUNCTION is applied only when app -ne 'scoop'; otherwise it falls back to 'current'.
Changelog update
CHANGELOG.md
Documented the behavioral change in currentdir regarding NO_JUNCTION and the 'scoop' app.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant core as lib/core.ps1
  rect rgb(235,245,255)
  Caller->>core: currentdir(app, NO_JUNCTION?)
  end
  rect rgb(245,255,235)
  core-->>core: if NO_JUNCTION == true\nand app != 'scoop'
  core-->>Caller: select non-junction current version
  end
  rect rgb(255,245,235)
  core-->>core: else
  core-->>Caller: fall back to 'current'
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single conditional modification in one core file.
  • Review focus: correctness of the new app name check and any tests or callers relying on NO_JUNCTION behavior.

Suggested reviewers

  • niheaven

Poem

A little rabbit hops through code, ✨
Skipping junctions down one road,
Scoop gets a simpler, gentler track,
Current paths now guide it back. 🐰

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: skipping NO_JUNCTION logic for the 'scoop' app in the currentdir function, which aligns with the core fix described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06c1324 and e91baab.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • lib/core.ps1 (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/core.ps1
  • CHANGELOG.md

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.

@z-Fng z-Fng changed the title fix(core): Skip NO_JUNCTION logic when app is 'scoop' in currentdir function fix(core): Skip NO_JUNCTION logic when $app is 'scoop' in currentdir function Nov 8, 2025
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