mirror of
https://github.com/octoleo/syncthing.git
synced 2025-02-08 23:08:27 +00:00
Fall back to %AppData% is %LocalAppData% is blank (fixes #1446)
This commit is contained in:
parent
80bffd93e7
commit
51cfc3d4be
@ -948,7 +948,10 @@ func ensureDir(dir string, mode int) {
|
|||||||
func getDefaultConfDir() (string, error) {
|
func getDefaultConfDir() (string, error) {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "windows":
|
case "windows":
|
||||||
return filepath.Join(os.Getenv("LocalAppData"), "Syncthing"), nil
|
if p := os.Getenv("LocalAppData"); p != "" {
|
||||||
|
return filepath.Join(p, "Syncthing"), nil
|
||||||
|
}
|
||||||
|
return filepath.Join(os.Getenv("AppData"), "Syncthing"), nil
|
||||||
|
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return osutil.ExpandTilde("~/Library/Application Support/Syncthing")
|
return osutil.ExpandTilde("~/Library/Application Support/Syncthing")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user