mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 16:34:30 +01:00
config: create config directory on save if it is missing
This commit is contained in:
parent
bc17ca7ed9
commit
e600217666
@ -445,6 +445,10 @@ func changeConfigPassword() {
|
||||
// if configKey has been set, the file will be encrypted.
|
||||
func saveConfig() error {
|
||||
dir, name := filepath.Split(ConfigPath)
|
||||
err := os.MkdirAll(dir, os.ModePerm)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to create config directory")
|
||||
}
|
||||
f, err := ioutil.TempFile(dir, name)
|
||||
if err != nil {
|
||||
return errors.Errorf("Failed to create temp file for new config: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user