aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cgitize/config.py4
-rw-r--r--cgitize/main.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/cgitize/config.py b/cgitize/config.py
index 84c7149..a630d7a 100644
--- a/cgitize/config.py
+++ b/cgitize/config.py
@@ -5,6 +5,7 @@
import configparser
import importlib
+import logging
import os.path
import sys
@@ -72,6 +73,9 @@ class Config:
def import_my_repos(self):
sys.path.append(os.path.dirname(self.my_repos))
+ if not os.path.exists(self.my_repos):
+ logging.error("Couldn't find my_repos.py at: %s", self.my_repos)
+ return None
module_name = os.path.splitext(os.path.basename(self.my_repos))[0]
module = importlib.import_module(module_name)
return module.MY_REPOS
diff --git a/cgitize/main.py b/cgitize/main.py
index 7d2632d..0c8f029 100644
--- a/cgitize/main.py
+++ b/cgitize/main.py
@@ -34,6 +34,8 @@ def main(args=None):
with setup_logging(args.verbose):
config = Config.read(args.config)
my_repos = config.import_my_repos()
+ if my_repos is None:
+ return 1
cgit_server = CGitServer(config.clone_url)
output = CGitRepositories(config.output, cgit_server, force=args.force)
success = True