mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
1 parent
9963f9df2d
commit
ec2787c99c
2 files changed
+84
No files matched your search
@@ -53,6 +53,10 @@ func (c *Config) Read() error {
|
||||
|
||||
func (c *Config) Save() error {
|
||||
dir, _ := filepath.Split(c.path)
|
||||
// If dir is empty (e.g., when path is just a filename), use current directory
|
||||
if dir == "" {
|
||||
dir = "."
|
||||
}
|
||||
if err := os.MkdirAll(dir, 0o700); err != nil {
|
||||
return fmt.Errorf("create config directory '%s': %w", dir, err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user