diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e91166..1521f17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ BUG FIXES: * cli: Update references to `hello-world` pack in command help text to `hello_world` [[GH-523](https://github.com/hashicorp/nomad-pack/pull/523)] * docker: Added tzdata to container to fix panics running packs containing periodic jobs with timezones [[GH-564](https://github.com/hashicorp/nomad-pack/pull/564)] +* cli: Replace path separators to slash on windows for local packs [[GH-578](https://github.com/hashicorp/nomad-pack/pull/578)] ## 0.1.2 (June 7, 2024) diff --git a/internal/pkg/cache/pack.go b/internal/pkg/cache/pack.go index 96466067..8a1b611e 100644 --- a/internal/pkg/cache/pack.go +++ b/internal/pkg/cache/pack.go @@ -7,6 +7,8 @@ import ( "os" "path" "path/filepath" + "runtime" + "strings" "github.com/hashicorp/nomad-pack/sdk/pack" ) @@ -46,7 +48,11 @@ func (cfg *PackConfig) Init() { func (cfg *PackConfig) initFromDirectory(packPath string) { // Keep the original user argument so that we can explain how to manage in output cfg.SourcePath = cfg.Name - cfg.Path = packPath + if runtime.GOOS == "windows" { + cfg.Path = strings.ReplaceAll(packPath, "\\", "/") + } else { + cfg.Path = packPath + } cfg.Name = path.Base(cfg.Path) cfg.Registry = DevRegistryName cfg.Ref = DevRef