From 781ad3b089cb6e93bd0c015c83591ba1c2c49401 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Sat, 17 Mar 2012 16:12:21 +0100 Subject: [PATCH] Write config file only if it doesn't exist --- bin/asciiio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/asciiio.py b/bin/asciiio.py index 6c87c5c..4be7874 100755 --- a/bin/asciiio.py +++ b/bin/asciiio.py @@ -408,8 +408,9 @@ def main(): if not os.path.isdir(BASE_DIR): os.mkdir(BASE_DIR) - with open(cfg_file, 'wb') as configfile: - config.write(configfile) + if not os.path.exists(cfg_file): + with open(cfg_file, 'wb') as configfile: + config.write(configfile) api_url = os.environ.get('ASCII_IO_API_URL', api_url)