From 709aed165a33f3661461495ea4e20a9da6252616 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Wed, 30 Jun 2021 16:32:43 -0400 Subject: [PATCH] refuse to deploy a site built with --fast --- build.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 3a2831b..40fe1f3 100644 --- a/build.py +++ b/build.py @@ -21,7 +21,8 @@ static_directory = 'static' output_directory = 'output' deploy_directory = '~/src/www-home' -md_extensions = ['fenced_code', 'codehilite', 'nl2br', 'toc', 'smarty', 'tables', 'linkify'] +md_extensions = [ + 'fenced_code', 'codehilite', 'nl2br', 'toc', 'smarty', 'tables', 'linkify'] def print_file(in_file, out_file): @@ -74,7 +75,8 @@ def process_markdown_files(): if page_url.endswith('index.html'): # strip off index.html page_url = page_url[:-len('index.html')] - html = markdown.markdown(text, extensions=md_extensions, output_format='html5') + html = markdown.markdown( + text, extensions=md_extensions, output_format='html5') output = template.format(title=title, content=html, page_url=page_url) os.makedirs(out_dirpath, exist_ok=True) @@ -129,7 +131,10 @@ def main(): make_rss() if args.deploy: - deploy_site() + if args.fast: + print('cowardly refusing to deploy a site that was built with --fast') + else: + deploy_site() if __name__ == '__main__':