From ecdaa614b50ffec7662df9511ebef22d3711c7b0 Mon Sep 17 00:00:00 2001 From: RomanBudnyk <41344963+RomanBudnyk@users.noreply.github.com> Date: Tue, 13 Aug 2024 17:25:16 +0300 Subject: [PATCH] fix porchtl push method for windows we are compiling the porchctl to use it on Windows. the proposed fix is changing the Windows path representation to the Unix-based one. --- pkg/cli/commands/rpkg/push/command.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cli/commands/rpkg/push/command.go b/pkg/cli/commands/rpkg/push/command.go index 2e7d9298..3be99e4d 100644 --- a/pkg/cli/commands/rpkg/push/command.go +++ b/pkg/cli/commands/rpkg/push/command.go @@ -254,7 +254,12 @@ func readFromDir(dir string) (map[string]string, error) { }); err != nil { return nil, err } - return resources, nil + newRes := make(map[string]string) + for key, value := range resources { + newKey := strings.ReplaceAll(key, "\\", "/") + newRes[newKey] = value + } + return newRes, nil } func readFromReader(in io.Reader) (map[string]string, error) {