From 46f119b2245be0e92bddd280853143f91f5d40bf Mon Sep 17 00:00:00 2001 From: Andreas Bieber Date: Wed, 25 Apr 2018 14:40:45 +0200 Subject: [PATCH] Fix resolving relative paths on windows path.Dir() does not support Windows-style directory separators (backslashes). This caused invocations such as "helmfile -f subdir\helmfile.yml" to fail. Fixed by using filepath.Dir() instead. --- state/state.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/state/state.go b/state/state.go index 4a4b39db..5154f33b 100644 --- a/state/state.go +++ b/state/state.go @@ -15,7 +15,6 @@ import ( "github.com/roboll/helmfile/helmexec" "bytes" - "path" "regexp" yaml "gopkg.in/yaml.v1" @@ -91,7 +90,7 @@ func ReadFromFile(file string) (*HelmState, error) { func readFromYaml(content []byte, file string) (*HelmState, error) { var state HelmState - state.BaseChartPath, _ = filepath.Abs(path.Dir(file)) + state.BaseChartPath, _ = filepath.Abs(filepath.Dir(file)) if err := yaml.Unmarshal(content, &state); err != nil { return nil, err }