X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/d86043614b6adee66ceece9a01532d47feea3ee3..6a81e334136308b5c4e23c37f30ace17f4c9de1f:/unitproc/bktemp-initGitRepo?ds=inline diff --git a/unitproc/bktemp-initGitRepo b/unitproc/bktemp-initGitRepo index a222ad3..905e929 100644 --- a/unitproc/bktemp-initGitRepo +++ b/unitproc/bktemp-initGitRepo @@ -2,8 +2,6 @@ # Desc: Initializes a git repository #==BEGIN Define script parameters== -#==END Define script parameters== - #===BEGIN Declare local script functions=== yell() { echo "$0: $*" >&2; } #o Yell, Die, Try Three-Fingered Claw technique die() { yell "$*"; exit 111; } #o Ref/Attrib: https://stackoverflow.com/a/25515370 @@ -33,7 +31,7 @@ initGitRepo() { # arg2: repoDir # arg3: remoteName # arg4: branchName - # Version: 0.0.4 + # Version: 0.0.5 # Depends: checkURL() 0.0.2, yell(), Bash 5.0.3 # Ref/Attrib: [1]: Test for space-less alphanuemric string. https://unix.stackexchange.com/a/416120 # [2]: Test for argument count. https://stackoverflow.com/q/18568706 @@ -47,6 +45,9 @@ initGitRepo() { if checkURL "$arg1"; then repoURL="$arg1"; else yell "ERROR:Not a valid URL:$arg1"; return 1; fi; + # Passthrough repoDir (it may not exist yet) + repoDir="$arg2"; + # Validate remoteName if [[ "$arg3" =~ ^[[:alnum:]]+$ ]]; then remoteName="$arg3"; else yell "ERROR:Not a valid remote name:$arg3"; return 1; fi; # See [1]. @@ -78,6 +79,7 @@ initGitRepo() { #==END create and populate git repository== } # Init Git Repository #===END Declare local script functions=== +#==END Define script parameters== #==BEGIN sample code tmpDir=/tmp/"$(date +%Y%m%dT%H%M%S%z)";