Skip to content

Commit

Permalink
make updateScript to work
Browse files Browse the repository at this point in the history
Closes: nix-community#91
`updateScript` will use the same golang version to update the project.
  • Loading branch information
yihuang committed Sep 2, 2022
1 parent cc75990 commit 36adb78
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
, cacert
, pkgs
, pkgsBuildBuild
, runtimeShell
, writeScript
, writeShellScript
, gomod2nix
}:
let
Expand Down Expand Up @@ -404,7 +403,6 @@ let

passthru = {
inherit go vendorEnv;
} // optionalAttrs (hasAttr "goPackagePath" modulesStruct) {

updateScript =
let
Expand All @@ -415,13 +413,12 @@ let
(
map (subPackage: modulesStruct.goPackagePath + "/" + subPackage) modulesStruct.subPackages
)
else modulesStruct.goPackagePath;

else (modulesStruct.goPackagePath or "");
helper = gomod2nix.override { inherit go; };
in
writeScript "${pname}-updater" ''
#!${runtimeShell}
writeShellScript "${attrs.pname or ""}-updater" ''
${optionalString (pwd != null) "cd ${toString pwd}"}
exec ${gomod2nix}/bin/gomod2nix generate ${generatorArgs}
exec ${helper}/bin/gomod2nix generate ${generatorArgs}
'';

} // passthru;
Expand Down

0 comments on commit 36adb78

Please sign in to comment.