fix(unitproc:initGitRepo):Improve usability
[BK-2020-03.git] / unitproc / bktemp-initGitRepo
index e5d117c88b11ed26de3d236b86d96bf265736478..4575dafcc4f5090368d3828541dab7d0d72d5b8e 100644 (file)
@@ -31,7 +31,7 @@ initGitRepo() {
     #        arg2: repoDir
     #        arg3: remoteName
     #        arg4: branchName
-    # Version: 0.0.4
+    # Version: 0.0.6
     # 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
@@ -45,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].
@@ -65,7 +68,6 @@ initGitRepo() {
     else
        yell "STATUS:Already a git repository:$repoDir";
        git status; git remote -v;
-       yell "STATUS:Pausing 4 seconds..."; sleep 4;
     fi;
     yell "STATUS:Adding $repoURL as remote $remoteName";
     git remote add "$remoteName" "$repoURL";
@@ -74,6 +76,7 @@ initGitRepo() {
     unset repoURL repoDir remoteName branchName;
     popd || exit 1;
     #==END create and populate git repository==
+    yell "================================";
 } # Init Git Repository
 #===END Declare local script functions===
 #==END Define script parameters==