Skip to content

Commit 8eb1fc2

Browse files
committed
fix(config): use path/filepath for OS-correct path separators
1 parent ee58a76 commit 8eb1fc2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pkg/config/localconfig.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package config
33
import (
44
"fmt"
55
"os"
6-
"path"
6+
"path/filepath"
77
"slices"
88

99
configUtil "github.com/microcks/microcks-cli/pkg/util"
@@ -109,7 +109,7 @@ func DefaultConfigDir() (string, error) {
109109
return "", nil
110110
}
111111

112-
configDir = path.Join(homeDir, ".config", "microcks")
112+
configDir = filepath.Join(homeDir, ".config", "microcks")
113113

114114
return configDir, nil
115115
}
@@ -130,7 +130,7 @@ func DefaultLocalConfigPath() (string, error) {
130130
if err != nil {
131131
return "", err
132132
}
133-
return path.Join(dir, "config"), nil
133+
return filepath.Join(dir, "config"), nil
134134
}
135135

136136
// DefaultLocalWatchPath returns the local watch configuration path.
@@ -139,7 +139,7 @@ func DefaultLocalWatchPath() (string, error) {
139139
if err != nil {
140140
return "", err
141141
}
142-
return path.Join(dir, "watch"), nil
142+
return filepath.Join(dir, "watch"), nil
143143
}
144144

145145
// ValidateLocalConfig validates the local configuration.
@@ -155,7 +155,7 @@ func ValidateLocalConfig(config LocalConfig) error {
155155

156156
// WriteLocalConfig writes a new local configuration file.
157157
func WriteLocalConfig(config LocalConfig, configPath string) error {
158-
err := os.MkdirAll(path.Dir(configPath), os.ModePerm)
158+
err := os.MkdirAll(filepath.Dir(configPath), os.ModePerm)
159159
if err != nil {
160160
return err
161161
}
@@ -407,7 +407,7 @@ func ReadLocalWatchConfig(path string) (*WatchConfig, error) {
407407

408408
// WriteLocalWatchConfig writes a new local watch configuration file.
409409
func WriteLocalWatchConfig(config WatchConfig, cfgPath string) error {
410-
err := os.MkdirAll(path.Dir(cfgPath), os.ModePerm)
410+
err := os.MkdirAll(filepath.Dir(cfgPath), os.ModePerm)
411411
if err != nil {
412412
return err
413413
}

0 commit comments

Comments
 (0)