Created
October 21, 2021 09:10
-
-
Save manigandand/b07018a86660eaaa7cefd5c8ac978cb2 to your computer and use it in GitHub Desktop.
go get private repo
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 | |
BRANCH=$1 | |
if [ "$BRANCH" == "" ]; then | |
BRANCH=$(git branch | grep "*" | sed s,*\ *,,g) | |
fi | |
if [ "$BRANCH" == "" ]; then | |
echo -n "No branch found" | |
exit 22; | |
fi | |
GIT_HASH=$(git ls-remote [email protected]:gopherhut/core $BRANCH | awk -F' ' '{print $1}') | |
COREMAJOR=$(cat go.mod | grep -Eo 'core/v\d+' | sed s,core,,g) | |
echo $AUXMAJOR | |
echo $GIT_HASH | |
go get github.com/gopherhut/core$COREMAJOR@$GIT_HASH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment