MinimalistGit

Project to automate creating git repos on a minimal 'git daemon' server.
Log | Files | Refs | README | LICENSE

commit 4f037db163bf77ec85fe497166f6fc41fa3f105e
parent ee70b031a9739d43aed069b0a34bb1ebb39d36e6
Author: Tyler Clark <tyler.clark@foxide.xyz>
Date:   Sun,  9 Feb 2025 21:47:07 -0500

Finished basic functionality of NewRepo.sh

Diffstat:
Mscripts/NewRepo.sh | 24+++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/scripts/NewRepo.sh b/scripts/NewRepo.sh @@ -3,7 +3,7 @@ # The arguments available for this script are: # # The public repo dirs will have a .git extension, -# while the private repos will not have an extension and the template repos will have a .template extension. +# while the private repos will have a .private extension and the template repos will have a .template extension. # If a repo is public and a template it will have .git.template. help() @@ -17,9 +17,10 @@ help() # This function will run to gather information for repo creation # If no arguments are given, this function will run to gather necessary information +# This script should also contain logic to change spaces to something else (probably '-') repoQuestions() { - echo "Please enter repository name" + echo "Please enter repository name, do not use spaces" read NAME echo "Will this be a private repo?" echo "y/n" @@ -37,13 +38,22 @@ repoQuestions() else TEMPLATE=0 fi - createRepo + createRepo $NAME $PRIVATE $TEMPLATE } createRepo() { - echo "Repo to create will be called: $NAME" - return 0 + if [ ${TEMPLATE} = 1 ] && [ ${PRIVATE} = 1 ]; then + mkdir ${NAME}.private.template + elif [ ${PRIVATE} = 1 ]; then + mkdir ${NAME}.private + elif [ ${TEMPLATE} = 1 ]; then + mkdir ${NAME}.template + else + mkdir ${NAME}.git + fi + + exit } if [ "$#" -eq 0 ]; then @@ -58,10 +68,10 @@ while getopts ":hptn:" f; do p) PRIVATE=1;; t) TEMPLATE=1;; h | *) help - break + exit ;; esac done shift `expr $OPTIND - 1` -createRepo $NAME +createRepo $NAME $PRIVATE $TEMPLATE