"configs/vscode:/vscode.git/clone" did not exist on "440e44a0e03d575bf682d35ab2771e88f774f4dc"
Commit 5eec5353 authored by longpanda's avatar longpanda
Browse files

--xdg improvement

parent 33a562c2
No preview for this file type
No preview for this file type
...@@ -1318,6 +1318,16 @@ int main(int argc, char **argv) ...@@ -1318,6 +1318,16 @@ int main(int argc, char **argv)
snprintf(g_log_file, sizeof(g_log_file), "%s/ventoy.log", env); snprintf(g_log_file, sizeof(g_log_file), "%s/ventoy.log", env);
touch_new_file(g_log_file); touch_new_file(g_log_file);
} }
else
{
env = getenv("HOME");
if (env && is_dir_exist("%s/.cache", env))
{
g_xdg_log = 1;
snprintf(g_log_file, sizeof(g_log_file), "%s/.cache/ventoy.log", env);
touch_new_file(g_log_file);
}
}
env = getenv("XDG_CONFIG_HOME"); env = getenv("XDG_CONFIG_HOME");
if (env) if (env)
...@@ -1326,6 +1336,16 @@ int main(int argc, char **argv) ...@@ -1326,6 +1336,16 @@ int main(int argc, char **argv)
snprintf(g_ini_file, sizeof(g_ini_file), "%s/Ventoy2Disk.ini", env); snprintf(g_ini_file, sizeof(g_ini_file), "%s/Ventoy2Disk.ini", env);
touch_new_file(g_ini_file); touch_new_file(g_ini_file);
} }
else
{
env = getenv("HOME");
if (env && is_dir_exist("%s/.config", env))
{
g_xdg_ini = 1;
snprintf(g_ini_file, sizeof(g_ini_file), "%s/.config/Ventoy2Disk.ini", env);
touch_new_file(g_ini_file);
}
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment