From b752d1ca48dd51ad2062b9bf4f5e5bb17fd0ef22 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Jun 2018 20:04:15 +0530 Subject: [PATCH] Publish installer.sh --- docs/installer.py | 4 ++-- docs/publish.py | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/installer.py b/docs/installer.py index 25c2d1169..361d7e8ac 100644 --- a/docs/installer.py +++ b/docs/installer.py @@ -223,9 +223,9 @@ def script_launch(): def update_intaller_wrapper(): - # To run: python3 -c "import runpy; runpy.run_path('installer.py', run_name='update_wrapper')" + # To run: python3 -c "import runpy; runpy.run_path('installer.py', run_name='update_wrapper')" installer.sh src = open(__file__, 'rb').read().decode('utf-8') - wrapper = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'installer.sh') + wrapper = sys.argv[-1] with open(wrapper, 'r+b') as f: raw = f.read().decode('utf-8') nraw = re.sub(r'^# HEREDOC_START.+^# HEREDOC_END', lambda m: '# HEREDOC_START\n{}\n# HEREDOC_END'.format(src), raw, flags=re.MULTILINE | re.DOTALL) diff --git a/docs/publish.py b/docs/publish.py index f6d9c87d2..57618b6d6 100755 --- a/docs/publish.py +++ b/docs/publish.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2018, Kovid Goyal @@ -14,6 +14,11 @@ subprocess.check_call(['make', 'html'], cwd=docs_dir) if os.path.exists(publish_dir): shutil.rmtree(publish_dir) shutil.copytree(os.path.join(docs_dir, '_build', 'html'), publish_dir) +shutil.copy2(os.path.join(docs_dir, 'installer.sh'), publish_dir) +installer = os.path.join(docs_dir, 'installer.py') +subprocess.check_call([ + 'python3', '-c', f"import runpy; runpy.run_path('{installer}', run_name='update_wrapper')", + os.path.join(publish_dir, 'installer.sh')]) os.chdir(os.path.dirname(publish_dir)) subprocess.check_call(['git', 'add', 'kitty']) subprocess.check_call(['git', 'commit', '-m', 'kitty website updates'])