Last active
July 19, 2017 20:24
-
-
Save TripleDogDare/188ee09e93ff403e573d18af762d1692 to your computer and use it in GitHub Desktop.
Greenfield project initializer using go dep tool
This file contains 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/bash | |
set -euo pipefail | |
[ -z "${GOPATH:-}" ] && { | |
>&2 echo "GOPATH must be set" | |
exit 1 | |
} | |
# FIXME: Make less specific to this project | |
PROJECT_PATH='github.com/tripledogdare' | |
PROJECT_NAME=$(basename $PWD) | |
BASE_PATH="${GOPATH}/src/${PROJECT_PATH}" | |
FULL_PATH="${BASE_PATH}/${PROJECT_NAME}" | |
mkdir -p "$BASE_PATH" | |
TARGET=$PWD | |
( | |
cd $BASE_PATH | |
ln -sf "$TARGET" "$PROJECT_NAME" | |
) | |
dep init $FULL_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment