| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
Summary by CodeRabbit
WalkthroughTest-ValidateParameter now validates Scoop, global, and cache paths for invalid paths and existing files. It rejects non-empty Scoop or global directories. Scoop roots containing spaces are no longer rejected. Tests cover each validation case. ChangesInstallation validation
Explanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.) 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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7e9fb56e-fff1-4947-812b-1ad7b02d2889
📥 CommitsReviewing files that changed from the base of the PR and between 395043c and 2e5efa4.
📒 Files selected for processing (1)Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.
Sorry, something went wrong.
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
There was a problem hiding this comment.
install.ps1 (1)144-145: ⚠️ Potential issue | 🟡 Minor
Preserve literal, fail-closed directory validation.
Test-Path -Path "$DIR\*" interprets the path as a wildcard. It can miss hidden-only children, and path names containing wildcard characters can resolve incorrectly. The check can therefore allow installation into a non-empty directory. PowerShell documents this wildcard behavior, and hidden-item misses are documented in the PowerShell issue tracker. (learn.microsoft.com)
Use -LiteralPath for the directory check, enumerate with Get-ChildItem -Force, and treat enumeration errors as validation failures. This is the same unresolved issue reported previously.
$root = Join-Path $env:TEMP ("scoop-path-check-" + [guid]::NewGuid()) $hiddenDir = Join-Path $root 'hidden-only' $specialDir = Join-Path $root 'name[1]' [System.IO.Directory]::CreateDirectory($hiddenDir) | Out-Null [System.IO.Directory]::CreateDirectory($specialDir) | Out-Null $hiddenFile = Join-Path $hiddenDir '.keep' [System.IO.File]::WriteAllText($hiddenFile, '') [System.IO.File]::SetAttributes($hiddenFile, [System.IO.FileAttributes]::Hidden) [System.IO.File]::WriteAllText((Join-Path $specialDir 'keep'), '') try { [pscustomobject]@{ HiddenOnly_TestPath = Test-Path -Path "$hiddenDir\*" HiddenOnly_ForceCount = @(Get-ChildItem -LiteralPath $hiddenDir -Force).Count WildcardName_TestPath = Test-Path -Path "$specialDir\*" WildcardName_LiteralCount = @(Get-ChildItem -LiteralPath $specialDir -Force).Count } } finally { [System.IO.Directory]::Delete($root, $true) }Also applies to: 152-153
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3a41dc48-1fdf-419c-9cdf-a0a3e70dca38
📥 CommitsReviewing files that changed from the base of the PR and between 2e5efa4 and 20c916d.
📒 Files selected for processing (1)Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.
Sorry, something went wrong.
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c9935c28-d9cc-4413-b9e1-a6ff41f9ae06
📥 CommitsReviewing files that changed from the base of the PR and between 7e2af1f and c2419e5.
📒 Files selected for processing (2)Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
An alternative implementation of #76, relates to #60
This COULD be a BREAKING CHANGE, as the behavior has changed. Before this downstreams may run the installer to install Scoop into a directory that's non-empty, and with this PR it'll fail. But it's certain a bad idea to install Scoop into a non-empty directory because serious problems will arise, we should not support such installation.
Closes ScoopInstaller/Scoop#6655