Kaynağa Gözat

If a repo is already present, just use it as is

Ian Goldberg 3 hafta önce
ebeveyn
işleme
37ee023a51
1 değiştirilmiş dosya ile 6 ekleme ve 7 silme
  1. 6 7
      Scripts/clone-repos

+ 6 - 7
Scripts/clone-repos

@@ -14,8 +14,7 @@ fetch_repo() {
     update_crate="$4"
 
     if [ -d "$dir_name" ]; then
-        ( cd "$dir_name" && git fetch origin --tags && \
-            git checkout "$commit_id" )
+        echo "$dir_name already present"
     else
         git clone "$repo_url" "$dir_name" && \
         ( cd "$dir_name" && git checkout "$commit_id" && \
@@ -23,11 +22,11 @@ fetch_repo() {
             # of our own sigma-rs dependencies
             if [ -e "../patches/${dir_name}.diff" ]; then
                 patch -p1 < ../patches/${dir_name}.diff || exit 1
-            fi )
-    fi
-    # Update the Cargo.lock file to catch the now-local sigma-rs dependencies
-    if [ "$update_crate" != "" ]; then
-        ( cd "$dir_name" && cargo update "$update_crate" ) || exit 1
+            fi ) || exit 1
+        # Update the Cargo.lock file to catch the now-local sigma-rs dependencies
+        if [ "$update_crate" != "" ]; then
+            ( cd "$dir_name" && cargo update "$update_crate" ) || exit 1
+        fi
     fi
 }