sourcehut: fix-gqlgen-trimpath: conditionalize `go generate`

These directories might not exist for all modules, so don't fail the
build if they don't.

Signed-off-by: Christoph Heiss <christoph@c8h4.io>

+4 -4
+4 -4
pkgs/applications/version-management/sourcehut/fix-gqlgen-trimpath.nix
··· 6 6 # No need to workaround -trimpath: it's not used in goModules, 7 7 # but do download `go generate`'s dependencies nonetheless. 8 8 preBuild = '' 9 - go generate ./loaders 10 - go generate ./graph 9 + if [ -d ./loaders ]; then go generate ./loaders; fi 10 + if [ -d ./graph ]; then go generate ./graph; fi 11 11 ''; 12 12 }); 13 13 ··· 25 25 # If it fails, the gqlgenVersion may have to be updated. 26 26 preBuild = '' 27 27 unzip ''${GOPROXY#"file://"}/github.com/99designs/gqlgen/@v/v${gqlgenVersion}.zip 28 - go generate ./loaders 29 - go generate ./graph 28 + if [ -d ./loaders ]; then go generate ./loaders; fi 29 + if [ -d ./graph ]; then go generate ./graph; fi 30 30 rm -rf github.com 31 31 ''; 32 32 }