summaryrefslogtreecommitdiff
path: root/vendor.bat
diff options
context:
space:
mode:
authorCraig Wilson <craiggwilson@gmail.com>2015-11-06 08:28:48 -0600
committerCraig Wilson <craiggwilson@gmail.com>2015-11-06 12:47:59 -0600
commitb2e0d6ff82f7ed8f8cf990ef6b46cfde97473b94 (patch)
treec70ce555ecd69a64b593051a3b128a01d3dfc679 /vendor.bat
parentcbc7de14c453ee5596924b9d92f392c623c2fd9c (diff)
downloadmongo-b2e0d6ff82f7ed8f8cf990ef6b46cfde97473b94.tar.gz
fixed set_gopath.bat and added set_gopath.ps1, vendor.bat, and build.bat such that windows developers can contribute.
Diffstat (limited to 'vendor.bat')
-rw-r--r--vendor.bat31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor.bat b/vendor.bat
new file mode 100644
index 00000000000..5648d108b15
--- /dev/null
+++ b/vendor.bat
@@ -0,0 +1,31 @@
+@echo off
+
+setlocal EnableDelayedExpansion
+
+set GOPATH=%cd%\vendor
+
+for /F "eol=; tokens=1,2,3" %%i in (Godeps) do (
+ set package=%%i
+ set version=%%j
+ set dest=%%k
+ echo Getting package !package!
+
+ if not "!dest!"=="" (
+ set dest=!package!
+ set package=%%k
+ )
+
+ go get -u -d "!package!" >nul 2>&1
+ echo Setting package to version !version!
+ cd "%GOPATH%\src\!package!"
+ git checkout !version! >nul 2>&1
+
+ if not "!dest!"=="" (
+ cd "%GOPATH%"
+ if exist "%GOPATH%\src\!dest!" rd /s /q "%GOPATH%\src\!dest!"
+ xcopy "%GOPATH%\src\!package!" "%GOPATH%\src\!dest!" /Y /S /I >nul 2>&1
+ rd /s /q "%GOPATH%\src\!package!"
+ )
+)
+
+endlocal