1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

config: fix issues with memory-only config file paths

Fixes #5222
This commit is contained in:
albertony
2021-04-08 17:49:47 +02:00
parent b96ebfc40b
commit 23a0d4a1e6
11 changed files with 119 additions and 89 deletions

View File

@@ -535,12 +535,16 @@ func CopyRemote(name string) {
// ShowConfigLocation prints the location of the config file in use
func ShowConfigLocation() {
if _, err := os.Stat(ConfigPath); os.IsNotExist(err) {
fmt.Println("Configuration file doesn't exist, but rclone will use this path:")
if configPath := GetConfigPath(); configPath == "" {
fmt.Println("Configuration is in memory only")
} else {
fmt.Println("Configuration file is stored at:")
if _, err := os.Stat(configPath); os.IsNotExist(err) {
fmt.Println("Configuration file doesn't exist, but rclone will use this path:")
} else {
fmt.Println("Configuration file is stored at:")
}
fmt.Printf("%s\n", configPath)
}
fmt.Printf("%s\n", ConfigPath)
}
// ShowConfig prints the (unencrypted) config options