MinimalistGit

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

commit 6a0da8f069ed8adb6e43335dc8d2f90079cb1842
parent 0a09018d828ff2878d0034faca04d0288be48122
Author: Tyler Clark <tyler.clark@foxide.xyz>
Date:   Sun,  9 Feb 2025 21:47:07 -0500

Refactoring and refocusing NewRepo.sh

I decided to not go with using template and private repos for the time being.
I am not super comfortable with my understanding of how they work specifically,
and that is preventing me from properly implementing the feature.
It is something that I might add in the future, but will not be added until the base functaionlity
of this tool is more or less complete.

Diffstat:
Mscripts/NewRepo.sh | 56+++++++++++++++-----------------------------------------
1 file changed, 15 insertions(+), 41 deletions(-)

diff --git a/scripts/NewRepo.sh b/scripts/NewRepo.sh @@ -1,52 +1,23 @@ #!/bin/sh -# This script will automate the creation of Git repositories -# The arguments available for this script are: +# This script is intended to automate creating new repositories +# for a basic Git daemon server. # -# The public repo dirs will have a .git 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. +# The process should look like: +# 1. TODO Create ${REPO} +# 2. TODO Set description for ${REPO}, unless flag is set to skip +# 3. TODO Create main.md for ${REPO}, unless flag is set to skip +# 4. HOLD Copy license file to ${REPO}, unless flag is set to skip REPODIR="../Repos" -TEMPLATE=0 -PRIVATE=0 help() { - #echo "Usage: " - echo "-h: Prints this help menu" - echo "-n value: Gives repository name of value" - echo "-p: Makes the repository private" - echo "-t: Makes the repository a template repository" -} - -# 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, do not use spaces" - read NAME - echo "Will this be a private repo?" - echo "y/n" - read INPUT - if [ $INPUT = y ]; then - PRIVATE=1 - else - PRIVATE=0 - fi - echo "Will this repo be a template?" - echo "y/n" - read INPUT - if [ $INPUT = y ]; then - TEMPLATE=1 - else - TEMPLATE=0 - fi - createRepo $NAME $PRIVATE $TEMPLATE + echo "Will put something here once flags are decided fully." } createRepo() { +<<<<<<< HEAD if [ ${TEMPLATE} = 1 ] && [ ${PRIVATE} = 1 ]; then mkdir ${REPODIR}/${NAME}.private.template break @@ -61,13 +32,16 @@ createRepo() mkdir ${REPODIR}/${NAME}.git break fi +======= +>>>>>>> a6bae9d (Refactoring and refocusing NewRepo.sh) + + git init --bare ${REPODIR}/${NAME}.git + ${EDITOR} description - exit } if [ "$#" -eq 0 ]; then - #help - repoQuestions + help fi while getopts ":hptn:" f; do