Checkout the version tag when cloning repo

This commit is contained in:
Maxim Baz 2019-11-19 22:57:24 +01:00 committed by GitHub
parent 1cdccfa884
commit cc6af6e5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@
tmp=$(mktemp -d)
VERSION=$(cat ./src/cli/cli.go | grep 'Version = "v' | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
echo $VERSION
git clone --depth 1 https://github.com/schollz/croc $tmp/croc-${VERSION}
git clone -b v${VERSION} --depth 1 https://github.com/schollz/croc $tmp/croc-${VERSION}
(cd $tmp/croc-${VERSION} && go mod tidy && go mod vendor)
(cd $tmp && tar -cvzf croc_${VERSION}_src.tar.gz croc-${VERSION})
mv $tmp/croc_${VERSION}_src.tar.gz dist/