From aae210b048d267159975fcd7f8817c62074738e7 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sat, 19 Feb 2022 20:03:47 -0600 Subject: Add init to repo.py, remove repo.sh --- repo.sh | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100755 repo.sh (limited to 'repo.sh') diff --git a/repo.sh b/repo.sh deleted file mode 100755 index abc3e04..0000000 --- a/repo.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -e - -repo_location="/srv/git/" - -trimmed_repos="" -get_repos () { - trimmed_repos=() - repos=$(ssh marks.kitchen "ls -d $repo_location*.git") - for repo in $repos - do - repo_trim=$(basename $repo | cut -f 1 -d '.') - trimmed_repos+="$repo_trim " - done -} - -create_repo () { - dir="$repo_location$1.git" - ssh git@marks.kitchen "mkdir $dir" - ssh git@marks.kitchen "cd \"$dir\"; git init --bare; touch git-daemon-export-ok" -} - -case $1 in - create) # init a git repo here and create one on the server - create_repo $2 - dir="$repo_location$2.git" - printf "git init\n" - printf "git remote add origin git@marks.kitchen:$dir\n" - printf "git branch --set-upstream-to=origin/master master\n" - printf "git push\n" - ;; - list) # list repos on the server - get_repos - for repo in $trimmed_repos - do - printf "$repo\n" - done - ;; - clone) # clone a repo from the list - dir="$repo_location$2.git" - git clone git@marks.kitchen:$repo_location$dir - cd $dir - ;; - *) - printf "usage: ./repo [create|list|clone] args\n" - ;; -esac - -- cgit v1.2.3