From 59ac7f030e5b9bcc26ba158781ae370ed5121a27 Mon Sep 17 00:00:00 2001 From: Daniel Ludwig Date: Sat, 7 Jul 2018 09:37:59 +0200 Subject: [PATCH 1/3] fix typo in error message --- verbs/markdeep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verbs/markdeep.py b/verbs/markdeep.py index d6df1b7c..a6362b42 100644 --- a/verbs/markdeep.py +++ b/verbs/markdeep.py @@ -14,9 +14,9 @@ def run(fips_dir, proj_dir, args): markdeep.build(fips_dir, proj_dir) markdeep.view(fips_dir, proj_dir) else: - log.error("expected 'build' or 'serve' arg") + log.error("expected 'build' or 'view' arg") else: - log.error("expected 'build' or 'serve' arg") + log.error("expected 'build' or 'view' arg") def help(): log.info(log.YELLOW + From e3356ea0eaafb06bd343c48f65f88646e9ca807b Mon Sep 17 00:00:00 2001 From: Daniel Ludwig Date: Sat, 7 Jul 2018 11:56:30 +0200 Subject: [PATCH 2/3] 'fips clear' only prints configs effectively cleared --- mod/project.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/mod/project.py b/mod/project.py index 175a5cf0..eb5406b1 100644 --- a/mod/project.py +++ b/mod/project.py @@ -372,18 +372,26 @@ def clean(fips_dir, proj_dir, cfg_name) : proj_name = util.get_project_name_from_dir(proj_dir) configs = config.load(fips_dir, proj_dir, cfg_name) if configs : + num_cleaned_configs = 0 for cfg in configs : - log.colored(log.YELLOW, "=== clean: {}".format(cfg['name'])) - build_dir = util.get_build_dir(fips_dir, proj_name, cfg['name']) - if os.path.isdir(build_dir) : + build_dir_exists = os.path.isdir(build_dir) + deploy_dir = util.get_deploy_dir(fips_dir, proj_name, cfg['name']) + deploy_dir_exists = os.path.isdir(deploy_dir) + + if build_dir_exists or deploy_dir_exists : + log.colored(log.YELLOW, "=== clean: {}".format(cfg['name'])) + num_cleaned_configs += 1 + + if build_dir_exists : shutil.rmtree(build_dir) log.info(" deleted '{}'".format(build_dir)) - deploy_dir = util.get_deploy_dir(fips_dir, proj_name, cfg['name']) - if os.path.isdir(deploy_dir) : + if deploy_dir_exists : shutil.rmtree(deploy_dir) log.info(" deleted '{}'".format(deploy_dir)) + if num_cleaned_configs == 0 : + log.colored(log.YELLOW, "=== clean: nothing to clean for {}".format(cfg_name)) else : log.error("No valid configs found for '{}'".format(cfg_name)) From dd0ff07554d02fc5ffabdcb8c70e15c8f2597d83 Mon Sep 17 00:00:00 2001 From: Daniel Ludwig Date: Sat, 7 Jul 2018 12:04:38 +0200 Subject: [PATCH 3/3] print info message on 'fips diag imports' if project dir isn't a git repository see #186 for an outline; this commit just prevents 'fips diag' to falsely report status of a parent repository, if there is one. --- mod/dep.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/dep.py b/mod/dep.py index 20e35729..6630d36c 100644 --- a/mod/dep.py +++ b/mod/dep.py @@ -456,10 +456,13 @@ def check_imports(fips_dir, proj_dir) : num_imports += 1 log.info("git status of '{}':".format(imp_proj_name)) if os.path.isdir(imp_proj_dir) : - if git.check_out_of_sync(imp_proj_dir) : - log.warn(" '{}' is out of sync with remote git repo".format(imp_proj_dir)) + if os.path.isdir("{}/.git".format(imp_proj_dir)) : + if git.check_out_of_sync(imp_proj_dir) : + log.warn(" '{}' is out of sync with remote git repo".format(imp_proj_dir)) + else : + log.colored(log.GREEN, ' uptodate') else : - log.colored(log.GREEN, ' uptodate') + log.colored(log.GREEN, " '{}' is not a git repository".format(imp_proj_dir)) else : log.warn(" '{}' does not exist, please run 'fips fetch'".format(imp_proj_dir)) if success and num_imports == 0 :