gomod2nix/builder/fetch.sh

14 lines
307 B
Bash
Raw Permalink Normal View History

2022-05-28 13:49:49 +00:00
source $stdenv/setup
export HOME=$(mktemp -d)
# Call once first outside of subshell for better error reporting
2022-05-28 13:50:18 +00:00
go mod download "$goPackagePath@$version"
2022-05-28 13:49:49 +00:00
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