瀏覽代碼

hack/vendor.sh: overwrite existing dependencies and remove .git so they can be checked in

Solomon Hykes 12 年之前
父節點
當前提交
45cedefadb
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 2 1
      .gitignore
  2. 5 3
      hack/vendor.sh

+ 2 - 1
.gitignore

@@ -14,5 +14,6 @@ docs/_templates
 .gopath/
 .gopath/
 .dotcloud
 .dotcloud
 *.test
 *.test
-vendor/
 bundles/
 bundles/
+.hg/
+.git/

+ 5 - 3
hack/vendor.sh

@@ -12,10 +12,12 @@ git_clone () {
   (
   (
     set -e
     set -e
     cd $vendor_dir
     cd $vendor_dir
-    if [[ ! -d src/$PKG ]]; then
-      cd $vendor_dir && git clone http://$PKG src/$PKG
+    if [[ -d src/$PKG ]]; then
+      echo "src/$PKG already exists. Removing."
+      rm -fr src/$PKG
     fi
     fi
-    cd src/$PKG && git checkout -f $REV
+    cd $vendor_dir && git clone http://$PKG src/$PKG
+    cd src/$PKG && git checkout -f $REV && rm -fr .git
   )
   )
 }
 }