commit ee70b031a9739d43aed069b0a34bb1ebb39d36e6 parent afac03b4a9b928e64d81dbd4ee493088e55b71f2 Author: Tyler Clark <tyler.clark@foxide.xyz> Date: Sun, 9 Feb 2025 21:47:07 -0500 Added function for running the script without arguments and started working on the logic to determine how the repos will be named and managed Diffstat:
M | scripts/NewRepo.sh | | | 41 | ++++++++++++++++++++++++++++++++++------- |
1 file changed, 34 insertions(+), 7 deletions(-)
diff --git a/scripts/NewRepo.sh b/scripts/NewRepo.sh @@ -15,22 +15,48 @@ help() echo "-t, --template: Makes the repository a template repository" } -createRepo() +# This function will run to gather information for repo creation +# If no arguments are given, this function will run to gather necessary information +repoQuestions() { - + echo "Please enter repository name" + 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 } -echo "$#" +createRepo() +{ + echo "Repo to create will be called: $NAME" + return 0 +} if [ "$#" -eq 0 ]; then - help + #help + repoQuestions fi while getopts ":hptn:" f; do case $f in - n) echo "Dir name: ${OPTARG}.git";; - p) echo "Repo will be private";; - t) echo "Repo will be a template";; + #n) echo "Dir name: ${OPTARG}.git";; + n) NAME=${OPTARG};; + p) PRIVATE=1;; + t) TEMPLATE=1;; h | *) help break ;; @@ -38,3 +64,4 @@ while getopts ":hptn:" f; do done shift `expr $OPTIND - 1` +createRepo $NAME