Skip to content

supercollider: Add Version 3.14.1#17233

Open
Gulfy034 wants to merge 6 commits intoScoopInstaller:masterfrom
Gulfy034:supercollider
Open

supercollider: Add Version 3.14.1#17233
Gulfy034 wants to merge 6 commits intoScoopInstaller:masterfrom
Gulfy034:supercollider

Conversation

@Gulfy034
Copy link

@Gulfy034 Gulfy034 commented Feb 18, 2026

SuperCollider is an useful tool/IDE for sound synthesis and algorithmic composition.

The IDE uses KDE/Qt-framework and seems like it can not change the default config file paths env yet on Windows.
Ref: https://github.com/supercollider/supercollider/wiki/Path-searching
and also: https://github.com/supercollider/supercollider/blob/develop/common/SC_Filesystem_win.cpp

So in order to install it for not taking up the main drive's space, make SymbolicLinks optionally in the script for the user app support link $env:localappdata\SuperCollider to persist_dir\LocalAppdata and also the system app support path $env:programdata\SuperCollider is linked to persist_dir\ProgramData .

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary by CodeRabbit

  • New Features

    • Added a Windows installer manifest for SuperCollider with versioned releases, auto-update rules, shortcuts, persistent config, and install/uninstall hooks.
  • Chores

    • Added scripts to create and remove symlinked LocalAppData and ProgramData locations under the managed install prefix.
    • Added a helper to check/enforce PowerShell execution policy.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Walkthrough

Adds a new Scoop manifest for SuperCollider plus PowerShell scripts to create/remove ProgramData and LocalAppData symbolic links, manage execution-policy checks, and wire GitHub-releases-based checkver/autoupdate logic.

Changes

Cohort / File(s) Summary
Scoop manifest
bucket/supercollider.json
New manifest: metadata, arch-specific download URLs & hashes, install topology (bin, shortcuts, persist), pre/post install/uninstall hooks, checkver and autoupdate rules pointing to GitHub Releases.
LocalAppData symlink scripts
scripts/supercollider/link-localappdata.ps1, scripts/supercollider/unlink-localappdata.ps1
Scripts to migrate LocalAppData\SuperCollider into the Scoop app directory, create or remove a symlink at the original LocalAppData path; use temporary ExecutionPolicy ByPass and guarded copy/remove semantics.
ProgramData symlink scripts
scripts/supercollider/link-programdata.ps1, scripts/supercollider/unlink-programdata.ps1
Scripts to migrate or link ProgramData\SuperCollider to a Scoop-managed ProgramData path and to remove that symlink on uninstall; verify admin context, use guarded copy/remove and temporary ExecutionPolicy bypass.
ExecutionPolicy test
scripts/supercollider/test.ps1
Small script to check Process ExecutionPolicy and set RemoteSigned for the session if not present; colored status output.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Scoop as Scoop (installer)
    participant GH as GitHub Releases
    participant FS as Filesystem

    rect rgba(200,230,201,0.5)
    User->>Scoop: scoop install supercollider
    end

    Scoop->>GH: query latest release (checkver/autoupdate)
    GH-->>Scoop: release metadata + asset URLs
    Scoop->>Scoop: resolve arch-specific URL & hash
    Scoop->>Scoop: download & extract archive
    Scoop->>FS: install files into scoop/apps/supercollider/<version>
    Scoop->>FS: create persist directories and shortcuts
    Scoop->>FS: run pre_install scripts (`link-programdata.ps1`, `link-localappdata.ps1`)
    Scoop->>FS: run post_install scripts (symlinks/shortcuts)
    FS-->>User: SuperCollider ready
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

review-needed

Suggested reviewers

  • z-Fng

Poem

🐰 I hopped into the bucket bright,
I stitched the paths by dim lamplight.
Manifests, links, and release hashes too —
I moved the data, then made it new.
Scoop sings softly — joy in view.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new SuperCollider manifest for version 3.14.1 to the Scoop bucket.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description adequately explains the purpose (SuperCollider package addition), provides technical context about Windows path limitations, references relevant documentation, and confirms required checklist items completion.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@github-actions
Copy link
Contributor

Your changes did not pass all checks.

Please address the issues in the manifest and comment starting with /verify to rerun the checks.

Invalid manifests

  • supercollider

Check the full log for details.

Copy link

@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: 6

🧹 Nitpick comments (1)
bucket/supercollider.json (1)

70-74: Redundant github field in checkver alongside an explicit url

github is a shorthand that sets the URL to check against the GitHub releases endpoint. Since url is already explicitly provided (and overrides github's URL), the github field adds no value here. Remove it to keep the checkver block unambiguous.

♻️ Proposed fix
     "checkver": {
-        "github": "https://github.com/supercollider/supercollider",
         "url": "https://api.github.com/repositories/4228314/releases",
         "regex": "Version-([\\d.]+)"
     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 70 - 74, In the checkver block,
remove the redundant "github" field since "url" is explicitly provided and
overrides it; locate the JSON object named "checkver" and delete the "github"
key-value pair while keeping "url" and "regex" intact (i.e., ensure "url":
"https://api.github.com/repositories/4228314/releases" and "regex":
"Version-([\\d.]+)" remain unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bucket/supercollider.json`:
- Around line 45-49: The symlink creation using New-Item -ItemType SymbolicLink
(targeting "$env:localappdata\\SuperCollider" ->
"$persist_dir\\LocalAppData\\SuperCollider") can fail without elevation or
Developer Mode; update the code around the New-Item calls and the conditional
that ensures "$persist_dir\\LocalAppData\\SuperCollider" to either (a) detect
Developer Mode via the registry key (or check for admin elevation) before
attempting New-Item and skip/notify if not enabled, or (b) wrap the New-Item
call in a try/catch that handles the "A required privilege is not held by the
client." error and writes a clear note to the package notes/installation
guidance (or logs) explaining the requirement; ensure the ensure call still
creates the target directory when needed and reference the exact symbols
New-Item -ItemType SymbolicLink, "$env:localappdata\\SuperCollider", and
"$persist_dir\\LocalAppData\\SuperCollider" when implementing the guard or error
handling.
- Around line 55-56: Remove the stray single-quote after $persist_dir in the
PowerShell path strings so the commands operate on the correct persistence path;
specifically replace occurrences of "$persist_dir'\\ProgramData\\SuperCollider"
with "$persist_dir\\ProgramData\\SuperCollider" in the JSON entries for the
PowerShell commands (the lines containing the ensure command, the Copy-Item
command, and the Test-Path call) so those commands use the correct target path.
- Around line 59-62: The manifest is creating a symlink under
"$env:programdata\SuperCollider" (New-Item -ItemType SymbolicLink -Path
"$env:programdata\SuperCollider" -Target
"$persist_dir\ProgramData\SuperCollider") which always requires elevation and
will fail for non-admin user installs; either (A) stop touching $env:programdata
for user installs and create the link under "$env:localappdata\SuperCollider"
(or just use files inside "$persist_dir") or (B) convert the manifest to a
global install (set the manifest to global/scope=global) and document the
admin-elevation requirement; also fix the malformed ensure call (ensure
"$persist_dir'\\ProgramData\\SuperCollider") to use the correct quotes so the
path is built correctly.
- Line 4: The manifest's "homepage" value uses an insecure URL; update the JSON
entry for the "homepage" key in supercollider.json from
"http://supercollider.github.io" to the secure "https://supercollider.github.io"
so the manifest consistently uses HTTPS.
- Around line 65-68: The pre_uninstall script uses Remove-Item on the two
symlink paths and will terminate if the items don't exist; update the
pre_uninstall block (the Remove-Item calls referencing
"$env:localappdata\\SuperCollider" and "$env:programdata\\SuperCollider") to
either check existence with Test-Path before calling Remove-Item or add the
PowerShell flag -ErrorAction SilentlyContinue to each Remove-Item invocation so
missing links don't throw a terminating error during uninstall.
- Line 14: Remove the invalid "require" manifest field entirely (it’s not part
of Scoop schema and CMake is only a build-time dependency), change the homepage
value to use HTTPS, fix the three stray single quotes in the pre_install script
by replacing occurrences of "$persist_dir'\\ProgramData\\SuperCollider" with
"$persist_dir\\ProgramData\\SuperCollider", add -ErrorAction SilentlyContinue to
the Remove-Item calls in pre_uninstall to avoid errors if symlinks are missing,
and ensure the New-Item -ItemType SymbolicLink calls (the symlink creation
lines) are documented/handled to require elevation or Developer Mode for
$env:PROGRAMDATA and $env:LOCALAPPDATA.

---

Nitpick comments:
In `@bucket/supercollider.json`:
- Around line 70-74: In the checkver block, remove the redundant "github" field
since "url" is explicitly provided and overrides it; locate the JSON object
named "checkver" and delete the "github" key-value pair while keeping "url" and
"regex" intact (i.e., ensure "url":
"https://api.github.com/repositories/4228314/releases" and "regex":
"Version-([\\d.]+)" remain unchanged).

"The system and user directories are now moved to the *SCOOP persist* path",
"For more information: https://github.com/supercollider/supercollider/wiki/Path-searching"
],
"require": "main/cmake",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, find and display the actual supercollider.json manifest file
find . -name "supercollider.json" -type f 2>/dev/null | head -5

Repository: ScoopInstaller/Extras

Length of output: 92


🏁 Script executed:

# Search for Scoop schema.json to verify property constraints
find . -name "schema.json" -type f 2>/dev/null | grep -i scoop

Repository: ScoopInstaller/Extras

Length of output: 47


🏁 Script executed:

# Check if "require" is mentioned anywhere in the repository as a valid field
rg '"require"' --type json -i | head -20

Repository: ScoopInstaller/Extras

Length of output: 119


🏁 Script executed:

cat -n ./bucket/supercollider.json

Repository: ScoopInstaller/Extras

Length of output: 5158


🌐 Web query:

Scoop package manager "require" vs "depends" manifest property

💡 Result:

In Scoop app manifests, there is no require (or requires) property—it’s not part of Scoop’s manifest schema. The supported field is depends. [1], [2]

  • depends: lists an app’s runtime dependencies (other Scoop apps) that Scoop will install automatically when installing the app. [1], [3]
  • If you saw #Requires, that’s a PowerShell script directive (e.g., inside pre_install/post_install scripts), not a Scoop manifest field. [1], [3]

Sources:
[1] Scoop Wiki – App Manifests (lists depends, no require) (github.com)
[2] Scoop schema.json (manifest schema includes depends, no require) (raw.githubusercontent.com)
[3] Scoop docs – Concepts (explains runtime deps via depends; install-time deps inferred) (scoop.netlify.app)

Citations:


🌐 Web query:

SuperCollider cmake runtime dependency requirements

💡 Result:

SuperCollider does not require CMake at runtime (i.e., to run sclang, scsynth, scide). CMake is a build-time dependency only.

  • Minimum CMake version to build SuperCollider from source: 3.12 (set by cmake_minimum_required(VERSION 3.12) in the project’s top-level CMakeLists.txt). [1]
  • The SuperCollider build docs likewise list CMake ≥ 3.12 as a required component for building (e.g., on Windows). [2]
  • Packaging evidence: Arch Linux lists cmake under “(make)” dependencies (build deps), not runtime deps, for the supercollider package. [3]

Bottom line: If you’re installing prebuilt SuperCollider binaries/packages, you typically do not need CMake installed; you only need it when compiling SuperCollider (or some extensions) from source. [1][3]

Sources: [1] [2] [3]


require is not a valid Scoop manifest field — remove it entirely

Scoop's schema defines depends for runtime dependencies, not require. However, CMake is a build-time dependency only—not required to run SuperCollider binaries. Since this manifest installs prebuilt binaries, the require line should be removed entirely.

Additionally, fix stray single-quotes in the pre_install script on lines 55, 56, and 61

These lines contain $persist_dir' (with a trailing quote) instead of $persist_dir, which will cause PowerShell to include a literal ' character in the path string, breaking the ensure and Copy-Item operations:

  • Line 55: "$persist_dir'\\ProgramData\\SuperCollider"
  • Line 56: "$persist_dir'\\ProgramData\\SuperCollider"
  • Line 61: "$persist_dir'\\ProgramData\\SuperCollider"

The symlink creation on lines 59 and 62 is correct (no stray quote), so data will fail to migrate.

Minor issues: Line 4 should use HTTPS for the homepage. Lines 67–68 in pre_uninstall should include -ErrorAction SilentlyContinue in case symlinks don't exist or removal fails. The symlink creation on lines 45, 49, 59, 62 requires admin elevation (or Developer Mode on Windows 10+) for $env:programdata and $env:localappdata.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` at line 14, Remove the invalid "require" manifest
field entirely (it’s not part of Scoop schema and CMake is only a build-time
dependency), change the homepage value to use HTTPS, fix the three stray single
quotes in the pre_install script by replacing occurrences of
"$persist_dir'\\ProgramData\\SuperCollider" with
"$persist_dir\\ProgramData\\SuperCollider", add -ErrorAction SilentlyContinue to
the Remove-Item calls in pre_uninstall to avoid errors if symlinks are missing,
and ensure the New-Item -ItemType SymbolicLink calls (the symlink creation
lines) are documented/handled to require elevation or Developer Mode for
$env:PROGRAMDATA and $env:LOCALAPPDATA.

Comment on lines +45 to +49
" New-Item -ItemType SymbolicLink -Path \"$env:localappdata\\SuperCollider\" -Target \"$persist_dir\\LocalAppData\\SuperCollider\"",
"}",
"else {",
" if (!(Test-Path \"$persist_dir\\LocalAppData\\SuperCollider\")) {ensure \"$persist_dir\\LocalAppData\\SuperCollider\" | Out-Null}",
" New-Item -ItemType SymbolicLink -Path \"$env:localappdata\\SuperCollider\" -Target \"$persist_dir\\LocalAppData\\SuperCollider\"",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Symlink creation in $env:localappdata requires elevation or Developer Mode

New-Item -ItemType SymbolicLink requires either admin privileges or Developer Mode on Windows 10+. Without one of these, this will fail with "A required privilege is not held by the client." Consider documenting this requirement in notes or guarding with a capability check (e.g., checking Developer Mode registry key or catching the error).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 45 - 49, The symlink creation using
New-Item -ItemType SymbolicLink (targeting "$env:localappdata\\SuperCollider" ->
"$persist_dir\\LocalAppData\\SuperCollider") can fail without elevation or
Developer Mode; update the code around the New-Item calls and the conditional
that ensures "$persist_dir\\LocalAppData\\SuperCollider" to either (a) detect
Developer Mode via the registry key (or check for admin elevation) before
attempting New-Item and skip/notify if not enabled, or (b) wrap the New-Item
call in a try/catch that handles the "A required privilege is not held by the
client." error and writes a clear note to the package notes/installation
guidance (or logs) explaining the requirement; ensure the ensure call still
creates the target directory when needed and reference the exact symbols
New-Item -ItemType SymbolicLink, "$env:localappdata\\SuperCollider", and
"$persist_dir\\LocalAppData\\SuperCollider" when implementing the guard or error
handling.

Comment on lines +55 to +56
" ensure \"$persist_dir'\\ProgramData\\SuperCollider\" | Out-Null",
" Copy-Item \"$env:programdata\\SuperCollider\\*\" \"$persist_dir'\\ProgramData\\SuperCollider\"",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Stray single-quote in $persist_dir' corrupts the ProgramData migration paths

Lines 55, 56, and 61 all have $persist_dir'\\ProgramData\\SuperCollider — the ' after $persist_dir is not escaped; PowerShell evaluates it as the variable value followed by a literal single-quote character. The result is a path like C:\Users\…\persist\supercollider'\ProgramData\SuperCollider which will never exist.

Crucially, the actual symlink target on lines 59 and 62 is correct (no stray quote), so the symlink points to the right place while the preceding ensure / Copy-Item / Test-Path calls operate on the wrong path — meaning existing user data would never be migrated and the persistence directory could fail to be created on first install.

🐛 Proposed fix — remove the stray `'` on the three affected lines
-        "       ensure \"$persist_dir'\\ProgramData\\SuperCollider\" | Out-Null",
-        "       Copy-Item \"$env:programdata\\SuperCollider\\*\" \"$persist_dir'\\ProgramData\\SuperCollider\"",
+        "       ensure \"$persist_dir\\ProgramData\\SuperCollider\" | Out-Null",
+        "       Copy-Item \"$env:programdata\\SuperCollider\\*\" \"$persist_dir\\ProgramData\\SuperCollider\"",
-        "   if (!(Test-Path \"$persist_dir\\ProgramData\\SuperCollider\")) {ensure \"$persist_dir'\\ProgramData\\SuperCollider\" | Out-Null}",
+        "   if (!(Test-Path \"$persist_dir\\ProgramData\\SuperCollider\")) {ensure \"$persist_dir\\ProgramData\\SuperCollider\" | Out-Null}",

Also applies to: 61-61

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 55 - 56, Remove the stray
single-quote after $persist_dir in the PowerShell path strings so the commands
operate on the correct persistence path; specifically replace occurrences of
"$persist_dir'\\ProgramData\\SuperCollider" with
"$persist_dir\\ProgramData\\SuperCollider" in the JSON entries for the
PowerShell commands (the lines containing the ensure command, the Copy-Item
command, and the Test-Path call) so those commands use the correct target path.

Copy link

@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: 5

🧹 Nitpick comments (4)
scripts/supercollider/unlink-localappdata.ps1 (1)

3-14: Set-ExecutionPolicy -Scope Process Undefined may lower the effective policy for the calling process.

These scripts run via Invoke-Expression in the same PowerShell process as Scoop. Resetting to Undefined removes the process-level override, falling back to the user/machine policy, which could be more restrictive than what Scoop expects for the remainder of the uninstall. Additionally, the ByPass→Undefined dance is unnecessary — Scoop's own process already allows script execution when it invokes manifest hooks.

Consider removing both Set-ExecutionPolicy calls from all four helper scripts.

♻️ Proposed fix
-# Ensure the current ExecutionPolicy
-
-Set-ExecutionPolicy -Scope Process ByPass
-
 `#Remove` the LocalAppdata SymbolicLink

 Write-Host "Removing LocalAppData SymbolicLink." -ForegroundColor Yellow
 if (Test-Path "$env:localappdata\SuperCollider") {
     Remove-Item -Path "$env:localappdata\SuperCollider" -Force -ErrorAction SilentlyContinue
 }
-
-# Reset the current ExecutionPolicy
-
-Set-ExecutionPolicy -Scope Process Undefined
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/unlink-localappdata.ps1` around lines 3 - 14, Remove
the temporary execution-policy changes: delete the two Set-ExecutionPolicy calls
in unlink-localappdata.ps1 (the initial "Set-ExecutionPolicy -Scope Process
ByPass" and the final "Set-ExecutionPolicy -Scope Process Undefined") so the
script no longer modifies process-level policy; likewise remove those same calls
from the other three helper scripts that use Invoke-Expression (they are
unnecessary because Scoop already runs hooks in a permissive process). Ensure no
other code depends on those symbols before committing.
bucket/supercollider.json (2)

55-58: checkver.github is redundant when url and regex are also specified.

When checkver.github is present, Scoop sets $url to the repo's /releases/latest and $regex to a default GitHub tag pattern, but the explicit url and regex properties override both. The github field serves no purpose here and may confuse maintainers.

♻️ Proposed simplification
     "checkver": {
-        "github": "https://github.com/supercollider/supercollider",
         "url": "https://api.github.com/repositories/4228314/releases",
         "regex": "Version-([\\d.]+)"
     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 55 - 58, The checkver block currently
defines checkver.github alongside explicit checkver.url and checkver.regex,
which is redundant; remove the checkver.github entry so only the explicit "url":
"https://api.github.com/repositories/4228314/releases" and "regex":
"Version-([\\d.]+)" remain in the JSON (i.e., delete the "github":
"https://github.com/supercollider/supercollider" line) to avoid confusion and
rely solely on the provided url/regex values.

24-26: suggest for cmake is misleading — cmake is a build-time dependency only.

This manifest installs prebuilt binaries. CMake is not needed at runtime. Suggesting it may confuse users into installing an unnecessary tool.

♻️ Proposed fix — remove the suggest block
-    "suggest": {
-        "cmake": "main/cmake"
-    },
     "architecture": {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 24 - 26, Remove the misleading
runtime suggestion by deleting the "suggest" JSON block that contains the
"cmake": "main/cmake" entry; specifically remove the "suggest" object (and its
"cmake" key) from the manifest so CMake is no longer advertised as a runtime
suggestion for this package.
scripts/supercollider/test.ps1 (1)

1-11: Remove the unused test.ps1 script from the directory.

The script is not referenced anywhere in the manifest—post_install copies only unlink-*.ps1 scripts, and notes, post_install, and pre_uninstall reference only link-* and unlink-* scripts. This appears to be a development artifact and should not ship in the bucket.

Additionally, line 9's elseif (($policy) -eq "RemoteSigned") is redundant; use else instead since the condition is the logical complement of line 5.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/test.ps1` around lines 1 - 11, Delete the unused script
named test.ps1 from the scripts/supercollider directory (it’s a development
artifact not referenced by the manifest or any install hooks); if you instead
need to retain it, either add it to the manifest/install hooks where appropriate
or simplify the conditional inside the script by replacing the redundant elseif
(($policy) -eq "RemoteSigned") branch with a plain else branch in the
policy-check logic to remove the unnecessary condition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bucket/supercollider.json`:
- Line 15: The JSON entry containing the command string for
unlink-localappdata.ps1 has a stray call operator (&) after "-Command" causing a
PowerShell syntax error; update the string that currently contains
'Invoke-Expression -Command & " & `"$dir\unlink-localappdata.ps1`"' to remove
the extra '&' so it reads '-Command "& `"$dir\unlink-localappdata.ps1`"' (i.e.,
ensure the -Command parameter directly takes the quoted string for
unlink-localappdata.ps1).
- Around line 67-72: The current "hash" block using "mode": "json" with jsonpath
"$[?(@.tag_name == 'Version-$version')].assets[?(@.browser_download_url ==
'$url')].digest" is unreliable for autoupdate; either remove the entire "hash"
block or change "mode" to "download" so Scoop will compute the hash from the
downloaded asset instead of relying on the fragile JSONPath extraction—update
the "hash" object accordingly or delete it from supercollider.json to ensure
consistent autoupdate behavior.

In `@scripts/supercollider/link-localappdata.ps1`:
- Around line 15-17: The Remove-Item call after Copy-Item is missing -Recurse so
it fails to remove a non-empty "$env:localappdata\SuperCollider" and causes
New-Item -ItemType SymbolicLink to fail; update the Remove-Item invocation (the
line using Remove-Item -Path "$env:localappdata\SuperCollider" -Force
-ErrorAction SilentlyContinue) to include -Recurse so the directory is fully
removed before creating the symlink with New-Item, keeping the existing -Force
and -ErrorAction flags.

In `@scripts/supercollider/link-programdata.ps1`:
- Around line 15-17: The Remove-Item call in link-programdata.ps1 is missing
-Recurse so it will fail on non-empty directories; update the Remove-Item
invocation that targets "$env:programdata\SuperCollider" to include -Recurse
(e.g., Remove-Item -Path "$env:programdata\SuperCollider" -Recurse -Force
-ErrorAction SilentlyContinue) so the directory and its contents are removed
before creating the symbolic link, matching the fix used in
link-localappdata.ps1.

In `@scripts/supercollider/unlink-programdata.ps1`:
- Around line 1-14: This script currently changes execution policy and hides
failures when removing the ProgramData symlink; update unlink-programdata.ps1 to
(1) capture and restore the prior execution policy rather than unconditionally
calling Set-ExecutionPolicy Undefined, (2) detect if the process is running as
administrator (use WindowsPrincipal.IsInRole for Administrator) and if not emit
a clear warning/exit so the pre_uninstall hook doesn’t silently leave a dangling
link, and (3) remove the -ErrorAction SilentlyContinue on Remove-Item so
failures are surfaced (or catch exceptions and log them via
Write-Error/Write-Host) while keeping only a process-scoped execution policy
change around the removal operation.

---

Duplicate comments:
In `@scripts/supercollider/link-localappdata.ps1`:
- Around line 17-21: Before calling New-Item to create the symlink at
$env:localappdata\SuperCollider, detect whether the script is running elevated
or whether Windows Developer Mode is enabled and bail with a clear message if
neither is true; implement a check using the Windows principal elevation API
(e.g., [Security.Principal.WindowsPrincipal] and
IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) and/or check
the Developer Mode registry key
(HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock\AllowDevelopmentWithoutDevLicense
or DeveloperModeEnable) and if not elevated and Developer Mode is not enabled,
write a helpful error that states "symlink creation requires admin elevation or
Windows Developer Mode (to avoid 'A required privilege is not held by the
client.')" and exit before calling New-Item for $env:localappdata\SuperCollider.

In `@scripts/supercollider/link-programdata.ps1`:
- Around line 17-21: The script uses New-Item to create a symbolic link at
"$env:programdata\SuperCollider" which requires an elevated PowerShell session;
update the script to detect and require elevation before running the New-Item
calls (or clearly document it) by checking for administrative privileges (e.g.,
Test-Path of an admin-only location or IsElevated), and if not elevated, print a
prominent note and exit/abort so non-admin Scoop installs don't fail; ensure the
message is placed near the top and references the New-Item symbolic link
creation for ProgramData so maintainers know why elevation is required.

---

Nitpick comments:
In `@bucket/supercollider.json`:
- Around line 55-58: The checkver block currently defines checkver.github
alongside explicit checkver.url and checkver.regex, which is redundant; remove
the checkver.github entry so only the explicit "url":
"https://api.github.com/repositories/4228314/releases" and "regex":
"Version-([\\d.]+)" remain in the JSON (i.e., delete the "github":
"https://github.com/supercollider/supercollider" line) to avoid confusion and
rely solely on the provided url/regex values.
- Around line 24-26: Remove the misleading runtime suggestion by deleting the
"suggest" JSON block that contains the "cmake": "main/cmake" entry; specifically
remove the "suggest" object (and its "cmake" key) from the manifest so CMake is
no longer advertised as a runtime suggestion for this package.

In `@scripts/supercollider/test.ps1`:
- Around line 1-11: Delete the unused script named test.ps1 from the
scripts/supercollider directory (it’s a development artifact not referenced by
the manifest or any install hooks); if you instead need to retain it, either add
it to the manifest/install hooks where appropriate or simplify the conditional
inside the script by replacing the redundant elseif (($policy) -eq
"RemoteSigned") branch with a plain else branch in the policy-check logic to
remove the unnecessary condition.

In `@scripts/supercollider/unlink-localappdata.ps1`:
- Around line 3-14: Remove the temporary execution-policy changes: delete the
two Set-ExecutionPolicy calls in unlink-localappdata.ps1 (the initial
"Set-ExecutionPolicy -Scope Process ByPass" and the final "Set-ExecutionPolicy
-Scope Process Undefined") so the script no longer modifies process-level
policy; likewise remove those same calls from the other three helper scripts
that use Invoke-Expression (they are unnecessary because Scoop already runs
hooks in a permissive process). Ensure no other code depends on those symbols
before committing.

Comment on lines +67 to +72
"hash": {
"mode": "json",
"url": "https://api.github.com/repositories/4228314/releases",
"jsonpath": "$[?(@.tag_name == 'Version-$version')].assets[?(@.browser_download_url == '$url')].digest",
"regex": "sha256:\\s*([a-f0-9]+)"
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether the SuperCollider 3.14.1 release assets actually have a non-null digest
curl -s "https://api.github.com/repos/supercollider/supercollider/releases" | \
  python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data:
    if r['tag_name'] == 'Version-3.14.1':
        for a in r.get('assets', []):
            print(f\"Asset: {a['name']}, digest: {a.get('digest', 'MISSING')}\")
        break
else:
    print('Release Version-3.14.1 not found')
"

Repository: ScoopInstaller/Extras

Length of output: 830


Remove hash block or switch to "mode": "download" for reliable autoupdate.

Scoop issue #6381 reports that complex JSONPath filters for asset digests don't work reliably in the autoupdate evaluator. While SuperCollider 3.14.1 assets do have digest values, Scoop's JSONPath implementation may fail to extract them using the filter $[?(@.browser_download_url == '$url')].digest, causing autoupdate to silently fall back to download-based hashing anyway. Removing the hash block entirely or switching to "mode": "download" ensures consistent and predictable behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 67 - 72, The current "hash" block
using "mode": "json" with jsonpath "$[?(@.tag_name ==
'Version-$version')].assets[?(@.browser_download_url == '$url')].digest" is
unreliable for autoupdate; either remove the entire "hash" block or change
"mode" to "download" so Scoop will compute the hash from the downloaded asset
instead of relying on the fragile JSONPath extraction—update the "hash" object
accordingly or delete it from supercollider.json to ensure consistent autoupdate
behavior.

Comment on lines +1 to +14
# Ensure the current ExecutionPolicy

Set-ExecutionPolicy -Scope Process ByPass

#Remove the ProgramData SymbolicLink

Write-Host "Removing ProgramData SymbolicLink." -ForegroundColor Yellow
if (Test-Path "$env:programdata\SuperCollider") {
Remove-Item -Path "$env:programdata\SuperCollider" -Force -ErrorAction SilentlyContinue
}

# Reset the current ExecutionPolicy

Set-ExecutionPolicy -Scope Process Undefined No newline at end of file
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Same Set-ExecutionPolicy concern as unlink-localappdata.ps1 applies here.

See the comment on the sibling script. Additionally, removing a symlink under $env:programdata typically requires admin elevation — the pre_uninstall hook that calls this script will fail silently (due to -ErrorAction SilentlyContinue) for non-admin users, leaving a dangling or stale symlink.

🧰 Tools
🪛 PSScriptAnalyzer (1.24.0)

[warning] 7-7: File 'unlink-programdata.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.

(PSAvoidUsingWriteHost)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/unlink-programdata.ps1` around lines 1 - 14, This
script currently changes execution policy and hides failures when removing the
ProgramData symlink; update unlink-programdata.ps1 to (1) capture and restore
the prior execution policy rather than unconditionally calling
Set-ExecutionPolicy Undefined, (2) detect if the process is running as
administrator (use WindowsPrincipal.IsInRole for Administrator) and if not emit
a clear warning/exit so the pre_uninstall hook doesn’t silently leave a dangling
link, and (3) remove the -ErrorAction SilentlyContinue on Remove-Item so
failures are surfaced (or catch exceptions and log them via
Write-Error/Write-Host) while keeping only a process-scoped execution policy
change around the removal operation.

Copy link

@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: 2

🧹 Nitpick comments (5)
bucket/supercollider.json (1)

55-59: checkver: fragile numeric repository ID and redundant github field.

  • "url": "https://api.github.com/repositories/4228314/releases" uses an internal numeric repo ID instead of the conventional slug-based URL (https://api.github.com/repos/supercollider/supercollider/releases). The numeric ID is undocumented and could break if GitHub ever changes routing.
  • Having both github and url in the same checkver block is unusual; url overrides the endpoint that github would generate, making github redundant here. Standard Scoop manifests that use a custom regex against the releases list only need url + regex.
  • The regex Version-([\d.]+) could also match pre-release tags like Version-3.15.0-beta1 (it stops correctly at -, so this is actually fine, but (\d+\.\d+\.\d+) is more precise).
♻️ Proposed simplification
 "checkver": {
-    "github": "https://github.com/supercollider/supercollider",
-    "url": "https://api.github.com/repositories/4228314/releases",
-    "regex": "Version-([\\d.]+)"
+    "github": "https://github.com/supercollider/supercollider",
+    "regex": "Version-([\\d.]+)"
 },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 55 - 59, The checkver block is
fragile: replace the numeric-repo URL with the slug-based GitHub API endpoint,
remove the redundant "github" field since "url" is being used, and tighten the
"regex" to a stricter semantic version pattern; specifically, update the
checkver to use url
"https://api.github.com/repos/supercollider/supercollider/releases", drop the
"github" key, and change regex "Version-([\d.]+)" to something like
"Version-(\d+\.\d+\.\d+)" so only proper semver tags are matched.
scripts/supercollider/link-localappdata.ps1 (2)

9-22: Script is not idempotent — re-running after the symlink is already in place copies a directory to itself.

When $env:localappdata\SuperCollider is already a symbolic link (script run a second time), Test-Path returns True for the link, so the if branch executes. Line 15 then resolves the symlink and copies its target ($current_dir\LocalAppData\SuperCollider) back into itself. On Windows, Copy-Item -Recurse -Force from a path to itself can fail with file-in-use or lock errors mid-way; with no error guard, the subsequent Remove-Item on line 16 then removes the symlink while data may be in an inconsistent state.

Add a reparse-point check so the migration branch is skipped when the symlink is already in place:

♻️ Proposed fix — skip migration when already a symlink
-if (Test-Path "$env:localappdata\SuperCollider") {
+$existingItem = Get-Item -LiteralPath "$env:localappdata\SuperCollider" -Force -ErrorAction SilentlyContinue
+if ($existingItem -and -not ($existingItem.Attributes -band [System.IO.FileAttributes]::ReparsePoint)) {
     Write-Host "Copying old '$env:localappdata\SuperCollider' to '$current_dir\LocalAppData\SuperCollider'" -ForegroundColor DarkGray
     ...
+} elseif (-not $existingItem) {
-} else {
     New-Item -ItemType SymbolicLink -Path "$env:localappdata\SuperCollider" -Target "$current_dir\LocalAppData\SuperCollider" | Out-Null
     Write-Host "Done."
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/link-localappdata.ps1` around lines 9 - 22, The script
currently treats an existing symlink at $env:localappdata\SuperCollider as a
normal directory and attempts to copy its target into itself; fix by checking
the item's reparse-point attribute before doing migration: use Get-Item on
$env:localappdata\SuperCollider and test its Attributes for the ReparsePoint
flag (or check .LinkType) and if it is a symlink, skip the Copy-Item/Remove-Item
migration steps and only ensure the desired symlink to
$current_dir\LocalAppData\SuperCollider exists; modify the branch that now runs
when Test-Path is true to first detect a reparse point and return early (or go
to the else behavior) so Copy-Item and Remove-Item are not invoked on an
existing symlink.

10-21: Write-Host flagged by PSScriptAnalyzer — consider Write-Verbose or Write-Information.

Write-Host cannot be redirected or suppressed in all PowerShell hosts. Write-Verbose (with $VerbosePreference) or Write-Information are the idiomatic alternatives for diagnostic messages.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/link-localappdata.ps1` around lines 10 - 21, Replace
the Write-Host calls in this script with an idiomatic, redirectable alternative
(e.g., Write-Verbose or Write-Information): locate the two Write-Host usages
around the copy/symlink logic and change them to Write-Verbose (or
Write-Information) so messages can be suppressed/redirected; if you use
Write-Verbose ensure callers can enable output via the -Verbose preference or
set $VerbosePreference appropriately, and if you choose Write-Information
include an appropriate MessageData or Tags argument for filterability. Ensure
the replacement messages remain the same text ("Copying old ...", "Done.") and
keep the surrounding logic (Test-Path, Copy-Item, Remove-Item, New-Item)
unchanged.
scripts/supercollider/link-programdata.ps1 (2)

9-22: Same re-entrancy concern as link-localappdata.ps1 — no check for pre-existing symlink.

Test-Path resolves symlinks, so a second run enters the migration branch, copies the directory to itself, and then recreates the same symlink. Consider the same reparse-point guard described for the sibling script.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/link-programdata.ps1` around lines 9 - 22, The script
uses Test-Path and will treat an existing symbolic link as a normal directory,
causing self-copying on rerun; before performing the migration (the block that
checks Test-Path "$env:programdata\SuperCollider"), check whether
"$env:programdata\SuperCollider" is a reparse point/symlink by calling Get-Item
and inspecting its Attributes (or using the FileAttributes.ReparsePoint bit) and
skip the copy/remove/new-item migration if it is already a symlink (or if it
already points to "$current_dir\ProgramData\SuperCollider"); keep the existing
uses of Test-Path, Remove-Item, and New-Item -ItemType SymbolicLink but guard
the migration branch with this reparse-point check so reruns are idempotent.

10-21: Write-Host flagged by PSScriptAnalyzer — consider Write-Verbose or Write-Information.

Same as the sibling link-localappdata.ps1 script.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/link-programdata.ps1` around lines 10 - 21, Replace the
Write-Host calls in link-programdata.ps1 with Write-Verbose (or
Write-Information) to satisfy PSScriptAnalyzer, and add a top-level
[CmdletBinding()] declaration so the script supports the -Verbose switch;
specifically, change the two Write-Host invocations (the "Copying old ..." and
"Done.") to Write-Verbose (or Write-Information) and add [CmdletBinding()] at
the top of the script, and apply the same replacement to the sibling
link-localappdata.ps1 to keep behavior consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bucket/supercollider.json`:
- Around line 51-54: pre_uninstall currently unconditionally invokes
unlink-programdata.ps1 which can fail for non-admin users and leave a dangling
%PROGRAMDATA%\SuperCollider symlink; change the pre_uninstall entry so the call
to unlink-programdata.ps1 is guarded: before invoking unlink-programdata.ps1
check whether the target ProgramData path exists and is a reparse point/symlink
(only call unlink-programdata.ps1 when the path exists and reports as a reparse
point), leave the unlink-localappdata.ps1 call as-is, and add a brief note in
the package notes documenting that removing the ProgramData link requires
elevation if it was created with link-programdata.ps1.

In `@scripts/supercollider/link-programdata.ps1`:
- Around line 17-20: Add a pre-flight elevation guard at the top of
link-programdata.ps1 that checks whether the current process is running as
Administrator (use WindowsPrincipal/WindowsIdentity IsInRole('Administrator'));
if not, re-launch the same script elevated using Start-Process -Verb RunAs with
the same arguments (or print a clear user-facing message and exit) so the
subsequent New-Item -ItemType SymbolicLink targeting
$env:programdata\SuperCollider won’t fail with access denied; ensure the check
covers both branches that call New-Item and that any relaunch preserves
necessary variables like $current_dir.

---

Duplicate comments:
In `@bucket/supercollider.json`:
- Around line 67-72: The nested JSONPath filter under the "hash" key (the object
with "mode":"json" and jsonpath "$[?(@.tag_name ==
'Version-$version')].assets[?(@.browser_download_url == '$url')].digest" and
regex "sha256:\\s*([a-f0-9]+)") is unreliable with the manifest evaluator;
remove the entire "hash" block so Scoop will compute the hash from the
downloaded artifact instead of using the fragile JSONPath-based value. Ensure no
other code references the removed "hash" key and keep the
autoupdate/autodownload fields intact so the runtime hash calculation is used.

In `@scripts/supercollider/link-localappdata.ps1`:
- Around line 15-17: No changes required: the script correctly uses -Recurse on
Copy-Item and Remove-Item now and creates the symbolic link with New-Item; leave
the commands Copy-Item "$env:localappdata\SuperCollider\*"
"$current_dir\LocalAppData\SuperCollider" -Recurse -Force, Remove-Item -Path
"$env:localappdata\SuperCollider" -Force -Recurse -ErrorAction SilentlyContinue,
and New-Item -ItemType SymbolicLink -Path "$env:localappdata\SuperCollider"
-Target "$current_dir\LocalAppData\SuperCollider" as-is and mark the change
approved.

In `@scripts/supercollider/link-programdata.ps1`:
- Around line 15-17: The change is good—Remove-Item now includes -Recurse to
delete a non-empty directory before creating the symlink; no functional fix
required. Verify the three commands (Copy-Item, Remove-Item with -Recurse, and
New-Item for the symbolic link) remain in that order and keep -Recurse and
-Force on Remove-Item and -Recurse on Copy-Item so the existing behavior is
preserved.

---

Nitpick comments:
In `@bucket/supercollider.json`:
- Around line 55-59: The checkver block is fragile: replace the numeric-repo URL
with the slug-based GitHub API endpoint, remove the redundant "github" field
since "url" is being used, and tighten the "regex" to a stricter semantic
version pattern; specifically, update the checkver to use url
"https://api.github.com/repos/supercollider/supercollider/releases", drop the
"github" key, and change regex "Version-([\d.]+)" to something like
"Version-(\d+\.\d+\.\d+)" so only proper semver tags are matched.

In `@scripts/supercollider/link-localappdata.ps1`:
- Around line 9-22: The script currently treats an existing symlink at
$env:localappdata\SuperCollider as a normal directory and attempts to copy its
target into itself; fix by checking the item's reparse-point attribute before
doing migration: use Get-Item on $env:localappdata\SuperCollider and test its
Attributes for the ReparsePoint flag (or check .LinkType) and if it is a
symlink, skip the Copy-Item/Remove-Item migration steps and only ensure the
desired symlink to $current_dir\LocalAppData\SuperCollider exists; modify the
branch that now runs when Test-Path is true to first detect a reparse point and
return early (or go to the else behavior) so Copy-Item and Remove-Item are not
invoked on an existing symlink.
- Around line 10-21: Replace the Write-Host calls in this script with an
idiomatic, redirectable alternative (e.g., Write-Verbose or Write-Information):
locate the two Write-Host usages around the copy/symlink logic and change them
to Write-Verbose (or Write-Information) so messages can be
suppressed/redirected; if you use Write-Verbose ensure callers can enable output
via the -Verbose preference or set $VerbosePreference appropriately, and if you
choose Write-Information include an appropriate MessageData or Tags argument for
filterability. Ensure the replacement messages remain the same text ("Copying
old ...", "Done.") and keep the surrounding logic (Test-Path, Copy-Item,
Remove-Item, New-Item) unchanged.

In `@scripts/supercollider/link-programdata.ps1`:
- Around line 9-22: The script uses Test-Path and will treat an existing
symbolic link as a normal directory, causing self-copying on rerun; before
performing the migration (the block that checks Test-Path
"$env:programdata\SuperCollider"), check whether
"$env:programdata\SuperCollider" is a reparse point/symlink by calling Get-Item
and inspecting its Attributes (or using the FileAttributes.ReparsePoint bit) and
skip the copy/remove/new-item migration if it is already a symlink (or if it
already points to "$current_dir\ProgramData\SuperCollider"); keep the existing
uses of Test-Path, Remove-Item, and New-Item -ItemType SymbolicLink but guard
the migration branch with this reparse-point check so reruns are idempotent.
- Around line 10-21: Replace the Write-Host calls in link-programdata.ps1 with
Write-Verbose (or Write-Information) to satisfy PSScriptAnalyzer, and add a
top-level [CmdletBinding()] declaration so the script supports the -Verbose
switch; specifically, change the two Write-Host invocations (the "Copying old
..." and "Done.") to Write-Verbose (or Write-Information) and add
[CmdletBinding()] at the top of the script, and apply the same replacement to
the sibling link-localappdata.ps1 to keep behavior consistent.

Comment on lines +51 to +54
"pre_uninstall": [
"Invoke-Expression -Command \"& `\"$dir\\unlink-localappdata.ps1`\"\"",
"Invoke-Expression -Command \"& `\"$dir\\unlink-programdata.ps1`\"\""
],
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

pre_uninstall will fail silently for non-admin users who set up the ProgramData symlink.

unlink-programdata.ps1 removes a symlink from %ProgramData%, which requires elevation. When a non-admin user runs scoop uninstall supercollider, pre_uninstall invokes the script, it fails with an access-denied error, but the app files are still removed by Scoop. This leaves a dangling (or still-active) symlink at %PROGRAMDATA%\SuperCollider pointing into a now-removed app directory, which is hard for users to diagnose and clean up.

Options:

  • Wrap the unlink calls with a guard that checks if a symlink actually exists at the target path before calling the unlink script.
  • Document in notes that uninstalling after using link-programdata.ps1 must be done from an elevated shell.
  • Gate the unlink-programdata.ps1 call on whether the path is a reparse point.
🐛 Proposed mitigation — guard on reparse point
 "pre_uninstall": [
     "Invoke-Expression -Command \"& `\"$dir\\unlink-localappdata.ps1`\"\"",
-    "Invoke-Expression -Command \"& `\"$dir\\unlink-programdata.ps1`\"\""
+    "if ((Get-Item -LiteralPath \"$env:programdata\\SuperCollider\" -Force -ErrorAction SilentlyContinue).Attributes -band [System.IO.FileAttributes]::ReparsePoint) { Invoke-Expression -Command \"& `\"$dir\\unlink-programdata.ps1`\"\" }"
 ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 51 - 54, pre_uninstall currently
unconditionally invokes unlink-programdata.ps1 which can fail for non-admin
users and leave a dangling %PROGRAMDATA%\SuperCollider symlink; change the
pre_uninstall entry so the call to unlink-programdata.ps1 is guarded: before
invoking unlink-programdata.ps1 check whether the target ProgramData path exists
and is a reparse point/symlink (only call unlink-programdata.ps1 when the path
exists and reports as a reparse point), leave the unlink-localappdata.ps1 call
as-is, and add a brief note in the package notes documenting that removing the
ProgramData link requires elevation if it was created with link-programdata.ps1.

@github-actions
Copy link
Contributor

Your changes did not pass all checks.

Please address the issues in the manifest and comment starting with /verify to rerun the checks.

supercollider

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

Copy link

@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: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bucket/supercollider.json`:
- Around line 24-26: Remove the erroneous runtime suggestion for CMake by
deleting the "suggest" entry that references "cmake" (the "cmake": "main/cmake"
pair) from the manifest; since CMake is only a build-time dependency for
producing the prebuilt SuperCollider binaries, ensuring the "suggest" key no
longer lists "cmake" will prevent misleading runtime installation guidance.
- Around line 48-52: pre_uninstall currently removes the symlinks
(unlink-localappdata.ps1 and unlink-programdata.ps1) but post_install only
copies the link scripts to $dir and does not recreate links, causing symlinks to
be lost on every update; update the bucket JSON so notes documents that users
must re-run the link commands after each update and modify post_install to
automatically invoke link-localappdata.ps1 (which does not require elevation)
after copying the scripts, while leaving link-programdata.ps1 as manual
(requires elevation); reference the post_install and pre_uninstall entries and
the script names link-localappdata.ps1, unlink-localappdata.ps1,
unlink-programdata.ps1, and the notes field when making the change.
- Around line 53-57: The checkver currently points at a releases list via the
"url" override and uses "regex": "Version-([\\d.]+)", which can match
pre-release tags; change it to rely on the standard "github" field (remove the
explicit "url" override) so Scoop queries /releases/latest which excludes
pre-releases, and also tighten the "regex" to anchor the match (e.g., require
end-anchor so tag suffixes like -rc don't match) — update the "checkver" block
(fields: github, url, regex) accordingly.

In `@scripts/supercollider/link-programdata.ps1`:
- Around line 23-25: Copy-Item in link-programdata.ps1 can produce
non-terminating errors so Remove-Item and New-Item run even if the copy failed;
update the script to guard the delete/link steps by making the copy fail fast
(use Copy-Item with -ErrorAction Stop or wrap the copy in a try/catch) and only
call Remove-Item and New-Item when the copy succeeded (or abort with a clear
error message), and apply the same pattern to link-localappdata.ps1; reference
the Copy-Item, Remove-Item, and New-Item calls when making the change.

In `@scripts/supercollider/unlink-programdata.ps1`:
- Line 8: Fix the typo in the user-facing message printed by the Write-Host
call: change the string used in Write-Host ("You NEED ADMIN permisson to remove
the programdata symlink.") to correct "permisson" -> "permission" so the message
reads properly when executed.

---

Duplicate comments:
In `@bucket/supercollider.json`:
- Around line 65-70: The nested JSONPath filter in the hash block (hash.mode,
the jsonpath "$[?(@.tag_name ==
'Version-$version')].assets[?(@.browser_download_url == '$url')].digest" and
regex) is unreliable in Scoop; remove the entire "hash" object (the hash block)
so Scoop will use download-based hashing fallback instead of the current
json-mode parsing.
- Around line 49-52: pre_uninstall currently always runs unlink-programdata.ps1
which prompts for admin and can remove non-existent symlinks; change
pre_uninstall to conditionally invoke unlink-programdata.ps1 only when the
ProgramData target is actually a reparse point (i.e., a symlink) created by
link-programdata.ps1. Locate the pre_uninstall entry and replace the
unconditional Invoke-Expression for unlink-programdata.ps1 with a PowerShell
check that inspects the %PROGRAMDATA%\SuperCollider path attributes
(Get-Item/.Attributes or Test-Path for reparse point) and only runs
unlink-programdata.ps1 when that check confirms a reparse point; keep
unlink-localappdata.ps1 behavior as-is or apply the same guard if desired.

In `@scripts/supercollider/link-programdata.ps1`:
- Line 8: Replace the four Write-Host calls in
scripts/supercollider/link-programdata.ps1 (e.g., the "You NEED ADMIN permisson
to add the programdata symlink." message and the other status messages) with
host-agnostic output calls: use Write-Output for simple status lines or
Write-Information for informational messages; remove any -ForegroundColor
arguments and preserve the original message text. Apply the same replacements to
the sibling scripts that have Write-Host usage.

In `@scripts/supercollider/unlink-programdata.ps1`:
- Around line 1-21: Replace the Write-Host calls with the appropriate structured
host helpers (use Write-Warning for the "Removing ProgramData SymbolicLink."
message and Write-Error for the permission failure) instead of Write-Host;
capture the current execution policy before calling Set-ExecutionPolicy -Scope
Process ByPass and restore that captured value in a finally block after the
removal attempt (use the same Set-ExecutionPolicy -Scope Process
<originalPolicy> to restore); stop swallowing errors on Remove-Item by removing
-ErrorAction SilentlyContinue and instead check the target with Test-Path and
confirm it's a symbolic link before removing (use Get-Item and inspect LinkType
or Attributes) and surface any non-symlink or removal errors via Write-Error so
admins can see failures.

Comment on lines +24 to +26
"suggest": {
"cmake": "main/cmake"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

suggest: cmake should be removed — CMake is a build-time dependency only

This manifest installs prebuilt SuperCollider binaries; CMake is not needed to run sclang, scsynth, or scide. Suggesting it will mislead users into installing an unneeded tool. The previous review cycle recommended removing it entirely; changing from the invalid require field to suggest didn't complete the fix.

🔧 Proposed fix
-    "suggest": {
-        "cmake": "main/cmake"
-    },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 24 - 26, Remove the erroneous runtime
suggestion for CMake by deleting the "suggest" entry that references "cmake"
(the "cmake": "main/cmake" pair) from the manifest; since CMake is only a
build-time dependency for producing the prebuilt SuperCollider binaries,
ensuring the "suggest" key no longer lists "cmake" will prevent misleading
runtime installation guidance.

Comment on lines +48 to +52
"post_install": "Copy-Item -Path \"$bucketsdir\\$bucket\\scripts\\$app\\*link-*.ps1\" \"$dir\"",
"pre_uninstall": [
"Invoke-Expression -Command \"& `\"$dir\\unlink-localappdata.ps1`\"\"",
"Invoke-Expression -Command \"& `\"$dir\\unlink-programdata.ps1`\"\""
],
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Symlinks are permanently removed on every scoop update and never auto-recreated

pre_uninstall removes both %LOCALAPPDATA%\SuperCollider and %PROGRAMDATA%\SuperCollider symlinks. post_install (line 48) only copies the scripts to $dir — it does not re-run them. After each scoop update supercollider, the symlinks are gone; SuperCollider will fall back to creating fresh config directories at those paths, silently bypassing the persistent data in $persist_dir until the user notices and re-runs the link scripts manually.

The notes section should document that users must re-run the link commands after every update. Consider also auto-running link-localappdata.ps1 (which doesn't require elevation) in post_install.

🔧 Minimal mitigation — document the update requirement in notes
     "notes": [
         "The IDE cache directories are at `%localappdata%\\scide` and `%appdata%\\scide` on Windows.",
         "------------",
+        "NOTE: After `scoop update supercollider`, re-run the link commands below to restore the symbolic links.",
+        "------------",
         "To make SymbolicLink from `%localappdata%\\SuperCollider` to the `persist_dir\\localappdata\\SuperCollider`, Run:",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 48 - 52, pre_uninstall currently
removes the symlinks (unlink-localappdata.ps1 and unlink-programdata.ps1) but
post_install only copies the link scripts to $dir and does not recreate links,
causing symlinks to be lost on every update; update the bucket JSON so notes
documents that users must re-run the link commands after each update and modify
post_install to automatically invoke link-localappdata.ps1 (which does not
require elevation) after copying the scripts, while leaving link-programdata.ps1
as manual (requires elevation); reference the post_install and pre_uninstall
entries and the script names link-localappdata.ps1, unlink-localappdata.ps1,
unlink-programdata.ps1, and the notes field when making the change.

Comment on lines +53 to +57
"checkver": {
"github": "https://github.com/supercollider/supercollider",
"url": "https://api.github.com/repositories/4228314/releases",
"regex": "Version-([\\d.]+)"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

checkver against /releases can match pre-release tags and produce false version bumps

The GitHub /releases endpoint returns all releases including pre-releases (RC builds). SuperCollider already has a Version-3.14.1-rc2 pre-release tag on the releases page. The regex Version-([\d.]+) matches the tag name up to the first non-[\d.] character, so a future tag like Version-3.15.0-rc1 would yield 3.15.0, causing autoupdate to construct a download URL for a stable release that doesn't yet exist and resulting in a 404.

Replace the explicit url override with the standard /releases/latest endpoint (via the github field alone), or add a re: filter anchored to exclude pre-releases.

🔧 Proposed fix — use /releases/latest via the standard github field
     "checkver": {
         "github": "https://github.com/supercollider/supercollider",
-        "url": "https://api.github.com/repositories/4228314/releases",
-        "regex": "Version-([\\d.]+)"
+        "regex": "Version-([\\d.]+)$"
     },

Using checkver.github alone makes Scoop query /releases/latest, which only returns the latest non-pre-release. The $ anchor on the regex additionally guards against partial matches on pre-release suffixes if the url override is kept.

📝 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
"checkver": {
"github": "https://github.com/supercollider/supercollider",
"url": "https://api.github.com/repositories/4228314/releases",
"regex": "Version-([\\d.]+)"
},
"checkver": {
"github": "https://github.com/supercollider/supercollider",
"regex": "Version-([\\d.]+)$"
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bucket/supercollider.json` around lines 53 - 57, The checkver currently
points at a releases list via the "url" override and uses "regex":
"Version-([\\d.]+)", which can match pre-release tags; change it to rely on the
standard "github" field (remove the explicit "url" override) so Scoop queries
/releases/latest which excludes pre-releases, and also tighten the "regex" to
anchor the match (e.g., require end-anchor so tag suffixes like -rc don't match)
— update the "checkver" block (fields: github, url, regex) accordingly.

Comment on lines +23 to +25
Copy-Item "$env:programdata\SuperCollider\*" "$current_dir\ProgramData\SuperCollider" -Recurse -Force
Remove-Item -Path "$env:programdata\SuperCollider" -Force -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType SymbolicLink -Path "$env:programdata\SuperCollider" -Target "$current_dir\ProgramData\SuperCollider" | Out-Null
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Data loss: Remove-Item executes even if Copy-Item fails partway

Copy-Item generates non-terminating errors by default (e.g., locked files from a running SuperCollider instance). If any files fail to copy, execution still falls through to Remove-Item -Recurse, which deletes the original %PROGRAMDATA%\SuperCollider that was incompletely backed up. The same pattern almost certainly affects link-localappdata.ps1.

🐛 Proposed fix — guard Remove-Item and New-Item on successful copy
-    Copy-Item "$env:programdata\SuperCollider\*" "$current_dir\ProgramData\SuperCollider" -Recurse -Force
-    Remove-Item -Path "$env:programdata\SuperCollider" -Force -Recurse -ErrorAction SilentlyContinue
-    New-Item -ItemType SymbolicLink -Path "$env:programdata\SuperCollider" -Target "$current_dir\ProgramData\SuperCollider" | Out-Null
-    Write-Host "Done."
+    Copy-Item "$env:programdata\SuperCollider\*" "$current_dir\ProgramData\SuperCollider" -Recurse -Force -ErrorAction Stop
+    Remove-Item -Path "$env:programdata\SuperCollider" -Force -Recurse -ErrorAction SilentlyContinue
+    New-Item -ItemType SymbolicLink -Path "$env:programdata\SuperCollider" -Target "$current_dir\ProgramData\SuperCollider" | Out-Null
+    Write-Host "Done."

Alternatively, wrap the three operations in a try/catch block so any copy failure aborts the migration with a clear error message before the original data is touched.

📝 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
Copy-Item "$env:programdata\SuperCollider\*" "$current_dir\ProgramData\SuperCollider" -Recurse -Force
Remove-Item -Path "$env:programdata\SuperCollider" -Force -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType SymbolicLink -Path "$env:programdata\SuperCollider" -Target "$current_dir\ProgramData\SuperCollider" | Out-Null
Copy-Item "$env:programdata\SuperCollider\*" "$current_dir\ProgramData\SuperCollider" -Recurse -Force -ErrorAction Stop
Remove-Item -Path "$env:programdata\SuperCollider" -Force -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType SymbolicLink -Path "$env:programdata\SuperCollider" -Target "$current_dir\ProgramData\SuperCollider" | Out-Null
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/link-programdata.ps1` around lines 23 - 25, Copy-Item
in link-programdata.ps1 can produce non-terminating errors so Remove-Item and
New-Item run even if the copy failed; update the script to guard the delete/link
steps by making the copy fail fast (use Copy-Item with -ErrorAction Stop or wrap
the copy in a try/catch) and only call Remove-Item and New-Item when the copy
succeeded (or abort with a clear error message), and apply the same pattern to
link-localappdata.ps1; reference the Copy-Item, Remove-Item, and New-Item calls
when making the change.

# Check Admin

if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "You NEED ADMIN permisson to remove the programdata symlink." -ForegroundColor DarkRed
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo in user-facing error message: "permisson" → "permission"

🔧 Proposed fix
-    Write-Host "You NEED ADMIN permisson to remove the programdata symlink." -ForegroundColor DarkRed
+    Write-Host "You NEED ADMIN permission to remove the programdata symlink." -ForegroundColor DarkRed
📝 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
Write-Host "You NEED ADMIN permisson to remove the programdata symlink." -ForegroundColor DarkRed
Write-Host "You NEED ADMIN permission to remove the programdata symlink." -ForegroundColor DarkRed
🧰 Tools
🪛 PSScriptAnalyzer (1.24.0)

[warning] 8-8: File 'unlink-programdata.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.

(PSAvoidUsingWriteHost)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/supercollider/unlink-programdata.ps1` at line 8, Fix the typo in the
user-facing message printed by the Write-Host call: change the string used in
Write-Host ("You NEED ADMIN permisson to remove the programdata symlink.") to
correct "permisson" -> "permission" so the message reads properly when executed.

@Gulfy034
Copy link
Author

/verify

@github-actions
Copy link
Contributor

All changes look good.

Wait for review from human collaborators.

supercollider

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Request]: supercollider

1 participant