aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-11-30 16:11:23 -0800
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-12-13 17:28:18 -0500
commite2dc648b93b77e45fde736ecbff8d0080fca41ff (patch)
tree57e3b87f15631c108e3f23f05d28e9f5243b93f5
parentbba5718890cbc3704528c028e104dde197d4c49c (diff)
downloadkorg-helpers-e2dc648b93b77e45fde736ecbff8d0080fca41ff.tar.gz
patchwork-bot: Create CACHEDIR if it is missing
Create the CACHEDIR if it is missing (e.g. the first time git-patchwork-bot is executed). Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211201001126.4106635-3-keescook@chromium.org
-rwxr-xr-xgit-patchwork-bot.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py
index d1eac6c..dc10fd0 100755
--- a/git-patchwork-bot.py
+++ b/git-patchwork-bot.py
@@ -1375,6 +1375,9 @@ if __name__ == '__main__':
cfgyaml = fh.read()
CONFIG = ruamel.yaml.safe_load(cfgyaml)
+ if not os.path.isdir(CACHEDIR):
+ os.makedirs(CACHEDIR, exist_ok=True)
+
if cmdargs.housekeeping:
for _pserver, _sconfig in CONFIG['patchworks'].items():
for _pname in _sconfig['projects']: