aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-11-05 11:47:24 -0400
committerBobby <[email protected]>2022-11-05 11:47:24 -0400
commit4e75bf11c541e6e152e32ceceabe45ca2309eda4 (patch)
tree91ba1f66e1f3e60b1a64f9ebf6c951ee5c48292d
parent1a370a35d03227e413584d4a5dfb4ea5d93c39b2 (diff)
downloadtexty-4e75bf11c541e6e152e32ceceabe45ca2309eda4.tar.xz
texty-4e75bf11c541e6e152e32ceceabe45ca2309eda4.zip
feat: added configure option to generate config script
-rw-r--r--README.md5
-rw-r--r--setup.py16
2 files changed, 17 insertions, 4 deletions
diff --git a/README.md b/README.md
index 7823aab..43954fe 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,11 @@ This will activate the virtual environment. You can now install the project's de
python3 setup.py install
+To configure aliases at this point, run the following command:
+
+ python3 setup.py configure
+ source bin/configure
+
This will install all the dependencies required to run the project. You can now start making changes.
### Committing Changes
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)
[email protected](help="Generate alias configuration script.")
+def configure():
+ Setup().configure()
+
+
+cli.add_command(configure)
+
+
if __name__ == "__main__":
cli()