From 51b47257e7f54c5ec0311b813a62673d0d40e299 Mon Sep 17 00:00:00 2001 From: Erfan Abdi Date: Mon, 6 Sep 2021 14:59:24 +0430 Subject: [PATCH] init: Add check for work dir before mkdir --- tools/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/__init__.py b/tools/__init__.py index 13a6110..cdb5cdd 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -36,7 +36,8 @@ def main(): print('ERROR: WayDroid is not initialized, run "waydroid init"') return 0 elif os.geteuid() == 0 and args.action == "init": - os.mkdir(args.work) + if not os.path.exists(args.work): + os.mkdir(args.work) else: args.log = "/tmp/tools.log" -- 2.47.3