summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/set_gopath.ps1
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/set_gopath.ps1')
-rw-r--r--src/mongo/gotools/set_gopath.ps19
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/gotools/set_gopath.ps1 b/src/mongo/gotools/set_gopath.ps1
new file mode 100644
index 00000000000..87f7dda2435
--- /dev/null
+++ b/src/mongo/gotools/set_gopath.ps1
@@ -0,0 +1,9 @@
+$goPath = "${pwd}\.gopath"
+$vendorPath = "${pwd}\vendor"
+
+# Using cmd invocation to recursively delete directories because Remove-Item -Recurse -Force
+# has a bug causing the script to fail.
+Invoke-Expression "cmd /c rd /s /q $goPath"
+New-Item $goPath\src\github.com\mongodb -ItemType Container | Out-Null
+Invoke-Expression "cmd /c mklink /J $goPath\src\github.com\mongodb\mongo-tools ${pwd}" | Out-Null
+$env:GOPATH = "$goPath;$vendorPath"