From 4e75bf11c541e6e152e32ceceabe45ca2309eda4 Mon Sep 17 00:00:00 2001 From: Bobby Date: Sat, 5 Nov 2022 11:47:24 -0400 Subject: feat: added configure option to generate config script --- setup.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 7b7bd4b..af1d49d 100644 --- a/setup.py +++ b/setup.py @@ -80,10 +80,9 @@ class Setup: else: logger.warn("Git author email not set.") - self.finish() + self.configure() - def finish(self): - logger.info("Setup finished.") + def configure(self): configure_path = "bin/configure" script = """#!{} alias commit="./commit.sh" @@ -101,7 +100,8 @@ echo "Run 'commit' to commit changes. Run 'commit -h' for help." configure_st = os.stat(configure_path) os.chmod(configure_path, configure_st.st_mode | 0o111) print( - """ + """Configuration script created. + You may want to configure aliases for commit and setup scripts. To do so, run the configurator binary: @@ -140,5 +140,13 @@ def install(): cli.add_command(install) +@click.command(help="Generate alias configuration script.") +def configure(): + Setup().configure() + + +cli.add_command(configure) + + if __name__ == "__main__": cli() -- cgit v1.2.3