mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-05 01:59:08 +00:00
Allow passing null
as modules for packages that don't have dependencies or that vendor them
This commit is contained in:
parent
0f5574480e
commit
94dc447f5c
1 changed files with 6 additions and 3 deletions
|
@ -221,7 +221,7 @@ let
|
|||
, ...
|
||||
}@attrs:
|
||||
let
|
||||
modulesStruct = fromTOML (readFile modules);
|
||||
modulesStruct = if modules == null then { } else fromTOML (readFile modules);
|
||||
|
||||
goModPath = "${toString pwd}/go.mod";
|
||||
|
||||
|
@ -268,10 +268,13 @@ let
|
|||
export GOSUMDB=off
|
||||
export GOPROXY=off
|
||||
cd "$modRoot"
|
||||
if [ -n "${vendorEnv}" ]; then
|
||||
|
||||
${optionalString (modulesStruct != { }) ''
|
||||
if [ -n "${vendorEnv}" ]; then
|
||||
rm -rf vendor
|
||||
cp -r ${vendorEnv} vendor
|
||||
fi
|
||||
fi
|
||||
''}
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue