chiark / gitweb /
init: only overwrites config.py, so run even if repo/ exists
authorHans-Christoph Steiner <hans@eds.org>
Wed, 23 Apr 2014 16:46:24 +0000 (12:46 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 23 Apr 2014 23:33:01 +0000 (19:33 -0400)
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

index 1448ae7966a87a9c16e4796d51bc3e69d75777c6..a6f53c6b1c41a266dc753d39fa59c204c38be6a8 100644 (file)
@@ -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)