From 76029d63899f9338ce56d0b13b1f5579559cd07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakobus=20Sch=C3=BCrz?= Date: Thu, 27 Feb 2020 13:20:59 +0100 Subject: [PATCH] create ~/.config if not exist --- workdirfs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workdirfs.py b/workdirfs.py index bb37f10..9eebf9f 100755 --- a/workdirfs.py +++ b/workdirfs.py @@ -58,7 +58,10 @@ class WorkdirFS(Operations): def _xdg(self): foundarchive=False foundwork=False - xdguserdirs = os.environ['HOME']+'/.config/user-dirs.dirs' + xdgdir = os.environ['HOME']+'/.config' + xdguserdirs = os.path.join(xdgdir, '/user-dirs.dirs') + if not os.path.exists(xdgdir): + os.mkdir(xdgdir) try: with fileinput.input(xdguserdirs, inplace=True) as fh: for line in fh: