gomod2nix/builder/fetch.sh

15 lines
358 B
Bash

source $stdenv/setup
export HOME=$(mktemp -d)
git config --global http.sslCAInfo $SSL_CERT_FILE
# Call once first outside of subshell for better error reporting
go mod download "$goPackagePath@$version"
dir=$(go mod download --json "$goPackagePath@$version" | jq -r .Dir)
chmod -R +w $dir
find $dir -iname ".ds_store" | xargs -r rm -rf
cp -r $dir $out