From 3cf3ad06fa244c0c3a147563caa683818d433e4b Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Sat, 16 Sep 2017 21:21:26 -0400 Subject: [PATCH] Trim the preference path in case any space/newlines are accidentally added --- src/duplicacy_preference.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/duplicacy_preference.go b/src/duplicacy_preference.go index b33be56..a1ad92d 100644 --- a/src/duplicacy_preference.go +++ b/src/duplicacy_preference.go @@ -5,6 +5,7 @@ package duplicacy import ( + "strings" "encoding/json" "path" "io/ioutil" @@ -43,7 +44,7 @@ func LoadPreferences(repository string) bool { LOG_ERROR("DOT_DUPLICACY_PATH", "Failed to locate the preference path: %v", err) return false } - realPreferencePath := string(content) + realPreferencePath := strings.TrimSpace(string(content)) stat, err := os.Stat(realPreferencePath) if err != nil { LOG_ERROR("PREFERENCE_PATH", "Failed to retrieve the information about the directory %s: %v", content, err)