From: Erfan Abdi Date: Mon, 6 Sep 2021 10:29:24 +0000 (+0430) Subject: init: Add check for work dir before mkdir X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/commitdiff_plain/51b47257e7f54c5ec0311b813a62673d0d40e299 init: Add check for work dir before mkdir --- 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"