Created
June 24, 2018 08:29
-
-
Save daniyel/207d442f6b73adf035f1ea6bd7262537 to your computer and use it in GitHub Desktop.
Wrapper for go dep dependency management tool to fix GOPATH for existing go project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CURR_DIR="$(PWD)" | |
PARENT_DIR="$(dirname $CURR_DIR)" | |
export GOPATH="$(mktemp -d "/tmp/dep.XXXXXXXX")" | |
trap "rm -rf \"${GOPATH}\"" EXIT HUP INT | |
SRCDIR="${GOPATH}/src/$PARENT_DIR" | |
mkdir -p "$(dirname "${SRCDIR}")" | |
ln -s "$(pwd)" "${SRCDIR}" | |
cd "${SRCDIR}" | |
dep "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment