Browse Source

install.sh: better workflow for falling back to master on dependency clones

Jonathan Daugherty 2 years ago
parent
commit
0b2f90fefb
1 changed files with 4 additions and 11 deletions
  1. 4
    11
      install.sh

+ 4
- 11
install.sh View File

@@ -48,19 +48,12 @@ function clone_or_update_repo {
48 48
 
49 49
     if [ ! -d "$destdir" ]
50 50
     then
51
-        echo git clone -b "$branch" "$repo" "$destdir"
52
-        if ! git clone -b "$branch" "$repo" "$destdir" 2> gitclone.err
51
+        git clone "$repo" "$destdir" 2> gitclone.err
52
+        cd $destdir
53
+        if ! git checkout "$branch"
53 54
         then
54
-            if grep -q "fatal: Remote branch ${branch} not found in upstream origin" gitclone.err
55
-            then
56
-                echo "Branch ${branch} does not exist; using master"
57
-                echo git clone "$repo" "$destdir"
58
-                git clone "$repo" "$destdir"
59
-            else
60
-                cat gitclone.err
61
-            fi
55
+            echo "Branch ${branch} does not exist; using master"
62 56
         fi
63
-
64 57
     else
65 58
         cd $destdir && git pull
66 59
     fi

Loading…
Cancel
Save