diff options
Diffstat (limited to 'testing/lab/xdg.patch')
-rw-r--r-- | testing/lab/xdg.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/lab/xdg.patch b/testing/lab/xdg.patch new file mode 100644 index 0000000000..f4b74d82ad --- /dev/null +++ b/testing/lab/xdg.patch @@ -0,0 +1,27 @@ +From 63bb26a320d43f8ce79626b0adeeaae73f90fd8a Mon Sep 17 00:00:00 2001 +From: Leo <thinkabit.ukim@gmail.com> +Date: Thu, 25 Jul 2019 04:05:41 -0300 +Subject: [PATCH] try XDG_CONFIG_HOME + +--- + main.go | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/main.go b/main.go +index dddf7a3..9a836b9 100644 +--- a/main.go ++++ b/main.go +@@ -35,7 +35,11 @@ func loadConfig() (string, string, string) { + home = u.HomeDir + } + } +- confpath := path.Join(home, ".config") ++ // Try XDG_CONFIG_HOME which is declared in XDG base directory specification ++ confpath := os.Getenv("XDG_CONFIG_HOME") ++ if confpath == "" { ++ confpath = path.Join(home, ".config") ++ } + if _, err := os.Stat(confpath); os.IsNotExist(err) { + os.Mkdir(confpath, 0700) + } + |