From a50baa7c309f7eb55fe87c71f4c688ace325b6ac Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Wed, 17 May 2017 17:10:45 +0200 Subject: Add logsDir setting and more - add logsDir setting in config.json - redirect Syncthing and Syncthing-inotify into log files - Use autogenerated Syncthing apikey if gui-apikey not set in config.json --- lib/common/filepath.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/common/filepath.go (limited to 'lib/common/filepath.go') diff --git a/lib/common/filepath.go b/lib/common/filepath.go new file mode 100644 index 0000000..603c2a2 --- /dev/null +++ b/lib/common/filepath.go @@ -0,0 +1,15 @@ +package common + +import "os" + +// Exists returns whether the given file or directory exists or not +func Exists(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if os.IsNotExist(err) { + return false + } + return true +} -- cgit 1.2.3-korg