Skip to content

Fix CLI path resolution on Linux - #19

Merged
jpol34 merged 2 commits into
mainfrom
fix-linux-cli-paths
Sep 16, 2026
Merged

jpol34 merged 2 commits into
mainfrom
fix-linux-cli-paths

Conversation

@jpol34

@jpol34 jpol34 commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Closes #18

Summary

  • bin/strongbox.ps1 (3 places), Install-StrongboxCli.ps1, ui/Start-StrongboxUi.ps1 (2 places), and Strongbox/Private/Get-StrongboxManifestPath.ps1 (2 places) all built paths with a literal embedded backslash inside a single Join-Path argument - only resolves on Windows.
  • Switched every occurrence to multi-segment Join-Path calls (e.g. Join-Path $PSScriptRoot '..' 'Strongbox' 'Strongbox.psd1'), which resolve correctly on both platforms.
  • Also fixed the same pattern in Tests/Strongbox.Tests.ps1's module import.

Test plan

  • 43/43 Pester tests pass on Windows (Invoke-Pester -Path Tests/Strongbox.Tests.ps1 -CI)
  • bin/strongbox.ps1 help runs cleanly in a fresh Debian bookworm arm64 container (matching the Pi's real OS/arch) - confirmed it failed at the very first Import-Module call before this fix, and succeeds after

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGra6GqN8qAxEDHbhmJwP2

jpol34 and others added 2 commits September 16, 2026 02:48
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
@jpol34
jpol34 merged commit c9dd53c into main Sep 16, 2026
1 check passed
@jpol34
jpol34 deleted the fix-linux-cli-paths branch September 16, 2026 23:01
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.

Fix CLI path resolution on Linux (bin/strongbox.ps1, Install-StrongboxCli.ps1)

1 participant