From cc089b49b1c47905e881a5e7ce1d4f23182ae824 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 23 Apr 2014 12:46:24 -0400 Subject: [PATCH] init: only overwrites config.py, so run even if repo/ exists Previously, `fdroid init` would exit if a repo/ subdir existed. Since it only changes config.py, that test just caused confusion. Now, only exit if config.py exists, and if repo/ does not exist, create it. --- fdroidserver/init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fdroidserver/init.py b/fdroidserver/init.py index 1448ae79..a6f53c6b 100644 --- a/fdroidserver/init.py +++ b/fdroidserver/init.py @@ -119,9 +119,10 @@ def main(): fdroiddir = os.getcwd() - if not os.path.exists('config.py') and not os.path.exists('repo'): + if not os.path.exists('config.py'): # 'metadata' and 'tmp' are created in fdroid - os.mkdir('repo') + if not os.path.exists('repo'): + os.mkdir('repo') shutil.copy(os.path.join(examplesdir, 'fdroid-icon.png'), fdroiddir) shutil.copyfile(os.path.join(examplesdir, 'config.py'), 'config.py') os.chmod('config.py', 0o0600) -- 2.30.2