mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
buildGoModule: supported structuredAttrs with subPackages
This commit is contained in:
parent
44d252e838
commit
f52e868a2e
1 changed files with 9 additions and 4 deletions
|
|
@ -320,10 +320,15 @@ lib.extendMkDerivation {
|
|||
}
|
||||
|
||||
getGoDirs() {
|
||||
local type;
|
||||
type="$1"
|
||||
if [ -n "$subPackages" ]; then
|
||||
echo "$subPackages" | sed "s,\(^\| \),\1./,g"
|
||||
local -r type="$1"
|
||||
|
||||
# Support strucuredAttrs, they are not space seperated
|
||||
local -a subPackagesArray
|
||||
concatTo subPackagesArray subPackages
|
||||
|
||||
# Outputs each element prefixed with './' if the array is not empty
|
||||
if [[ ''${#subPackagesArray[@]} -gt 0 ]]; then
|
||||
echo "''${subPackagesArray[*]/#/./}"
|
||||
else
|
||||
find . -type f -name \*$type.go -exec dirname {} \; | grep -v "/vendor/" | sort --unique | grep -v "$exclude"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue