Repository navigation
Fix CLI path resolution on Linux - #19
Merged
Merged
Conversation
bin/strongbox.ps1, Install-StrongboxCli.ps1, ui/Start-StrongboxUi.ps1, Get-StrongboxManifestPath.ps1, and Tests/Strongbox.Tests.ps1 all built paths with a literal embedded backslash inside a single Join-Path argument (e.g. Join-Path $PSScriptRoot '..\Strongbox\Strongbox.psd1'). That only resolves on Windows - Join-Path on Linux treats the whole string as one literal path segment, so the CLI's very first Import-Module call failed immediately. Ticket #5 (Linux parity) fixed the OS-conditional logic inside module functions but never exercised the bin/strongbox.ps1 entry point itself on Linux. Switched every occurrence to multi-segment Join-Path calls, which resolve correctly on both platforms. Verified: 43/43 Pester tests pass on Windows; `bin/strongbox.ps1 help` runs cleanly in a fresh Debian arm64 container (matching the Pi's actual OS/arch) after the fix, where it previously failed at the first Import-Module call. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGra6GqN8qAxEDHbhmJwP2
Every other file touched in this PR has this guard; the multi-segment Join-Path call added here relies on -AdditionalChildPath (PS 6+), so running this file under Windows PowerShell 5.1 without the guard degrades a clear "module requires PowerShellVersion 7.0" error into a confusing Join-Path parameter-binding error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGra6GqN8qAxEDHbhmJwP2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #18
Summary
bin/strongbox.ps1(3 places),Install-StrongboxCli.ps1,ui/Start-StrongboxUi.ps1(2 places), andStrongbox/Private/Get-StrongboxManifestPath.ps1(2 places) all built paths with a literal embedded backslash inside a singleJoin-Pathargument - only resolves on Windows.Join-Pathcalls (e.g.Join-Path $PSScriptRoot '..' 'Strongbox' 'Strongbox.psd1'), which resolve correctly on both platforms.Tests/Strongbox.Tests.ps1's module import.Test plan
Invoke-Pester -Path Tests/Strongbox.Tests.ps1 -CI)bin/strongbox.ps1 helpruns cleanly in a fresh Debian bookworm arm64 container (matching the Pi's real OS/arch) - confirmed it failed at the very firstImport-Modulecall before this fix, and succeeds after🤖 Generated with Claude Code
https://claude.ai/code/session_01WGra6GqN8qAxEDHbhmJwP2