From 90ed663f4ae5c77e800565dcdcc9fed76a0ebd1f Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Mon, 29 Sep 2025 16:57:46 +0800 Subject: [PATCH 1/4] fix(path): Trim ending slash when initializing path --- lib/core.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index b0e833c74b..cd11c935f4 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -622,7 +622,7 @@ function Get-AbsolutePath { $Path ) process { - return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path) + return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path).TrimEnd('\//') } } From 538fdd2cf699c61c46a68af1767ba5554641aed8 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Mon, 29 Sep 2025 17:09:26 +0800 Subject: [PATCH 2/4] update chglog --- CHANGELOG.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9875359d01..99889a0d27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,22 +2,23 @@ ### Features -- **scoop-uninstall**: Allow access to `$bucket` in uninstall scripts ([#6380](https://github.com/ScoopInstaller/Scoop/issues/6380)) +- **scoop-uninstall:** Allow access to `$bucket` in uninstall scripts ([#6380](https://github.com/ScoopInstaller/Scoop/issues/6380)) - **install:** Add separator at the end of notes, highlight suggestions ([#6418](https://github.com/ScoopInstaller/Scoop/issues/6418)) ### Bug Fixes -- **scoop-download**: Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) -- **scoop-uninstall:**: Correct `-Global` Switch ([#6454](https://github.com/ScoopInstaller/Scoop/issues/6454)) -- **scoop-update**: Force sync tags w/ remote branch while scoop update ([#6439](https://github.com/ScoopInstaller/Scoop/issues/6439)) +- **scoop-download:** Fix function `nightly_version` not defined error ([#6386](https://github.com/ScoopInstaller/Scoop/issues/6386)) +- **scoop-uninstall:** Correct `-Global` Switch ([#6454](https://github.com/ScoopInstaller/Scoop/issues/6454)) +- **scoop-update:** Force sync tags w/ remote branch while scoop update ([#6439](https://github.com/ScoopInstaller/Scoop/issues/6439)) - **autoupdate:** Use origin URL to handle URLs with fragment in GitHub mode ([#6455](https://github.com/ScoopInstaller/Scoop/issues/6455)) - **buckets|scoop-info:** Switch git log date format to ISO 8601 to avoid locale issues ([#6446](https://github.com/ScoopInstaller/Scoop/issues/6446)) - **scoop-version:** Fix logic error caused by missing brackets ([#6463](https://github.com/ScoopInstaller/Scoop/issues/6463)) - **core|manifest:** Avoid error messages when searching non-existent 'deprecated' directory ([#6471](https://github.com/ScoopInstaller/Scoop/issues/6471)) +- **path:** Trim ending slash when initializing paths ([#6501](https://github.com/ScoopInstaller/Scoop/issues/6501)) ### Code Refactoring -- **output**: Replace raw prints with functions for standardized output ([#6449](https://github.com/ScoopInstaller/Scoop/issues/6449)) +- **output:** Replace raw prints with functions for standardized output ([#6449](https://github.com/ScoopInstaller/Scoop/issues/6449)) ## [v0.5.3](https://github.com/ScoopInstaller/Scoop/compare/v0.5.2...v0.5.3) - 2025-08-11 From 9fa53a0255cc3849b40ea182f99837a2362b11c7 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Mon, 29 Sep 2025 17:17:15 +0800 Subject: [PATCH 3/4] use single slash here --- lib/core.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index cd11c935f4..275d985e4a 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -622,7 +622,7 @@ function Get-AbsolutePath { $Path ) process { - return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path).TrimEnd('\//') + return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path).TrimEnd('\/') } } From 9e632449fefe664b6d229ca47b9c58855b8dd6c1 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Tue, 21 Oct 2025 11:07:07 +0800 Subject: [PATCH 4/4] Skip root path --- lib/core.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index 275d985e4a..a23e8dd750 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -622,7 +622,14 @@ function Get-AbsolutePath { $Path ) process { - return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path).TrimEnd('\/') + $resolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path) + if ($resolvedPath -match '[\\/]$') { + $root = [System.IO.Path]::GetPathRoot($resolvedPath) + if ($resolvedPath -ine $root) { + $resolvedPath = $resolvedPath.TrimEnd([char[]]@('\', '/')) + } + } + return $resolvedPath } }