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>
This commit is contained in:
parent
8edd3e2105
commit
cf845d2e56
@ -6,8 +6,8 @@
|
||||
# No need to workaround -trimpath: it's not used in goModules,
|
||||
# but do download `go generate`'s dependencies nonetheless.
|
||||
preBuild = ''
|
||||
go generate ./loaders
|
||||
go generate ./graph
|
||||
if [ -d ./loaders ]; then go generate ./loaders; fi
|
||||
if [ -d ./graph ]; then go generate ./graph; fi
|
||||
'';
|
||||
});
|
||||
|
||||
@ -25,8 +25,8 @@
|
||||
# If it fails, the gqlgenVersion may have to be updated.
|
||||
preBuild = ''
|
||||
unzip ''${GOPROXY#"file://"}/github.com/99designs/gqlgen/@v/v${gqlgenVersion}.zip
|
||||
go generate ./loaders
|
||||
go generate ./graph
|
||||
if [ -d ./loaders ]; then go generate ./loaders; fi
|
||||
if [ -d ./graph ]; then go generate ./graph; fi
|
||||
rm -rf github.com
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user