From c36b8d11993106102f94c21bbb70f9003b2751bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Sat, 6 Jan 2018 21:16:14 +0100 Subject: [PATCH] packaging: Include bot .conf files in zulip_bots. --- zulip_bots/generate_manifest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zulip_bots/generate_manifest.py b/zulip_bots/generate_manifest.py index 3faaa69..617b440 100755 --- a/zulip_bots/generate_manifest.py +++ b/zulip_bots/generate_manifest.py @@ -77,6 +77,15 @@ def get_assets(): ) return assets_files +def get_config_templates(): + # type: () -> Iterator[str] + glob_pattern = os.path.join(BOTS_DIR, '*', '*.conf',) + assets_files = map( + lambda fp: os.path.join(*fp.split(os.path.sep)[-4:]).replace(os.path.sep, '/'), + glob.glob(glob_pattern) + ) + return assets_files + def generate_and_write(filepaths, file_obj): # type: (Iterator[str], IO[str]) -> None template = 'include {line}\n' @@ -92,12 +101,14 @@ def generate_dev_manifest(): generate_and_write(get_logos(), fp) generate_and_write(get_docs(), fp) generate_and_write(get_assets(), fp) + generate_and_write(get_config_templates(), fp) def generate_release_manifest(): # type: () -> None with open(MANIFEST_PATH, 'w') as fp: generate_and_write(get_docs(), fp) generate_and_write(get_assets(), fp) + generate_and_write(get_config_templates(), fp) def parse_args(): # type: () -> argparse.Namespace