Merge pull request #1 from mcmtroffaes/config-folder-fix

Fix config folder.
This commit is contained in:
abraunegg 2018-05-16 18:38:12 +10:00 committed by GitHub
commit bf7986df14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,15 +8,15 @@ int main(string[] args)
{ {
// Determine the user home directory. // Determine the user home directory.
// Need to avoid using ~ here as expandTilde() below does not interpret correctly when running under init.d scripts // Need to avoid using ~ here as expandTilde() below does not interpret correctly when running under init.d scripts
string homePath = environment.get("XDG_CONFIG_HOME"); string configPath = environment.get("XDG_CONFIG_HOME");
if (homePath == ""){ if (configPath == ""){
// XDG_CONFIG_HOME does not exist on systems where X11 is not present - ie - headless systems / servers // XDG_CONFIG_HOME does not exist on systems where X11 is not present - ie - headless systems / servers
// Get HOME environment variable // Get HOME environment variable
homePath = environment.get("HOME"); configPath = environment.get("HOME") ~ "/.config";
} }
// configuration directory // configuration directory
string configDirName = homePath ~ "/.config/onedrive"; string configDirName = configPath ~ "/onedrive";
// only download remote changes // only download remote changes
bool downloadOnly; bool downloadOnly;
// override the sync directory // override the sync directory