aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrepo.py12
1 files changed, 12 insertions, 0 deletions
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: