mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
Configuration directory is machine local (Windows)
This commit is contained in:
parent
9de2864db3
commit
1cd7cc6869
@ -130,7 +130,12 @@ func main() {
|
|||||||
// continue. We don't much care if this fails at this point, we will
|
// continue. We don't much care if this fails at this point, we will
|
||||||
// be checking that later.
|
// be checking that later.
|
||||||
|
|
||||||
oldDefault := expandTilde("~/.syncthing")
|
var oldDefault string
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
oldDefault = filepath.Join(os.Getenv("AppData"), "Syncthing")
|
||||||
|
} else {
|
||||||
|
oldDefault = expandTilde("~/.syncthing")
|
||||||
|
}
|
||||||
if _, err := os.Stat(oldDefault); err == nil {
|
if _, err := os.Stat(oldDefault); err == nil {
|
||||||
os.MkdirAll(filepath.Dir(confDir), 0700)
|
os.MkdirAll(filepath.Dir(confDir), 0700)
|
||||||
if err := os.Rename(oldDefault, confDir); err == nil {
|
if err := os.Rename(oldDefault, confDir); err == nil {
|
||||||
@ -670,7 +675,7 @@ func ensureDir(dir string, mode int) {
|
|||||||
func getDefaultConfDir() string {
|
func getDefaultConfDir() string {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "windows":
|
case "windows":
|
||||||
return filepath.Join(os.Getenv("AppData"), "Syncthing")
|
return filepath.Join(os.Getenv("LocalAppData"), "Syncthing")
|
||||||
|
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return expandTilde("~/Library/Application Support/Syncthing")
|
return expandTilde("~/Library/Application Support/Syncthing")
|
||||||
|
Loading…
Reference in New Issue
Block a user