From 7c23b32de3d599488b5af20d709ae717d9bf62b6 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sun, 14 Jun 2015 22:28:38 +0200 Subject: [PATCH] Default GUI override dir If STGUIASSETS is not set, look for assets in $confdir/gui by default. Simplifies deploying overrides and stuff. --- cmd/syncthing/locations.go | 2 ++ cmd/syncthing/main.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/cmd/syncthing/locations.go b/cmd/syncthing/locations.go index f2856267..663bc3ea 100644 --- a/cmd/syncthing/locations.go +++ b/cmd/syncthing/locations.go @@ -31,6 +31,7 @@ const ( locCsrfTokens = "csrfTokens" locPanicLog = "panicLog" locAuditLog = "auditLog" + locGUIAssets = "GUIAssets" locDefFolder = "defFolder" ) @@ -52,6 +53,7 @@ var locations = map[locationEnum]string{ locCsrfTokens: "${config}/csrftokens.txt", locPanicLog: "${config}/panic-${timestamp}.log", locAuditLog: "${config}/audit-${timestamp}.log", + locGUIAssets: "${config}/gui", locDefFolder: "${home}/Sync", } diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index cc472ac8..2e7910b1 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -252,6 +252,10 @@ func main() { l.Fatalln(err) } + if guiAssets == "" { + guiAssets = locations[locGUIAssets] + } + if runtime.GOOS == "windows" { if logFile == "" { // Use the default log file location