#!/bin/bash GO_VERSION=$(go version | awk '{for(i=1; i/dev/null || exit 1 git clone --branch $BRANCH https://github.com/goodwithtech/dockle.git pushd ./dockle >/dev/null || exit 1 sed -Ei "s/go\s+[0-9]+.*$/go ${GO_VERSION}/1" go.mod export GOPATH=${PWD}/mod go mod tidy rm -rf ./.github rm -rf ./.git rm -rf ./.vex popd >/dev/null mv ./dockle ./dockle-$VERSION tar -cvaf dockle-${VERSION}.tar.xz dockle-$VERSION || exit 1 mv dockle-${VERSION}.tar.xz ./.. popd >/dev/null sudo rm -rf ./source