From 8cd2b2fc35c208d4a072969e8cea35acaa831af4 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sun, 14 Jul 2024 15:22:15 -0500 Subject: Add description command --- repo.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'repo.py') diff --git a/repo.py b/repo.py index 281b271..69a05f9 100755 --- a/repo.py +++ b/repo.py @@ -37,6 +37,13 @@ def init_repo(args): else: print("Repo already exists") +def description(args): + name = args["name"] + description = args["description"] + git_dir = f"/srv/git/{name}.git" + subprocess.run([ + "ssh", "git@marks.kitchen", f"echo '{description}' > {git_dir}/description"]) + def add_gpl(args): subprocess.run(["wget", "--output-document=LICENSE", "https://www.gnu.org/licenses/gpl-3.0.txt"]) @@ -61,6 +68,11 @@ def main(): parser_license = subparsers.add_parser("license", help="add license") parser_license.set_defaults(command=add_gpl) + parser_description = subparsers.add_parser("description", help="set description") + parser_description.add_argument("name", type=str, help="repo name") + parser_description.add_argument("description", type=str, help="description") + parser_description.set_defaults(command=description) + args = vars(parser.parse_args()) callback = args["command"] if callback is None: -- cgit v1.2.3