mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-15 07:43:21 +00:00
Trim the preference path in case any space/newlines are accidentally added
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
package duplicacy
|
package duplicacy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"path"
|
"path"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@@ -43,7 +44,7 @@ func LoadPreferences(repository string) bool {
|
|||||||
LOG_ERROR("DOT_DUPLICACY_PATH", "Failed to locate the preference path: %v", err)
|
LOG_ERROR("DOT_DUPLICACY_PATH", "Failed to locate the preference path: %v", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
realPreferencePath := string(content)
|
realPreferencePath := strings.TrimSpace(string(content))
|
||||||
stat, err := os.Stat(realPreferencePath)
|
stat, err := os.Stat(realPreferencePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
LOG_ERROR("PREFERENCE_PATH", "Failed to retrieve the information about the directory %s: %v", content, err)
|
LOG_ERROR("PREFERENCE_PATH", "Failed to retrieve the information about the directory %s: %v", content, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user