Skip to content

Commit

Permalink
Replace path separators to slash on windows for local packs (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
teyyubismayil authored Oct 16, 2024
1 parent f095541 commit 6a3afbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ IMPROVEMENTS:
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)

Expand Down
8 changes: 7 additions & 1 deletion internal/pkg/cache/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strings"

"github.com/hashicorp/nomad-pack/sdk/pack"
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6a3afbd

Please sign in to comment.