"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
Fix "Couldn't find home directory" on OSX - fixes #15
Nick Craig-Woodaf9c44714629
diff --git a/fs/config.go b/fs/config.goindex c37fcd672..f1ba64fde 100644--- a/fs/config.go+++ b/fs/config.go@@ -56,11 +56,21 @@ type ConfigInfo struct {func configHome() string {// Find users home directoryusr, err := user.Current()- if err != nil {- log.Printf("Couldn't find home directory: %v", err)- return ""+ if err == nil {+ return usr.HomeDir+ }+ // Fall back to reading $HOME - work around user.Current() not+ // working for cross compiled binaries on OSX.+ // https://github.com/golang/go/issues/6376+ home := os.Getenv("HOME")+ if home != "" {+ return home}- return usr.HomeDir+ log.Printf("Couldn't find home directory or read HOME environment variable.")+ log.Printf("Defaulting to storing config in current directory.")+ log.Printf("Use -config flag to workaround.")+ log.Printf("Error was: %v", err)+ return ""}// Loads the config file