Correctly handle lua conversion for empty lists.
This commit is contained in:
parent
95e7679c82
commit
feaaf56e54
1 changed files with 12 additions and 9 deletions
|
@ -70,6 +70,7 @@ let
|
|||
listToLua =
|
||||
list:
|
||||
assert builtins.isList list;
|
||||
if list != [ ] then
|
||||
let
|
||||
wrap = (lib.elemAt list 0) != "__unpack";
|
||||
strippedList = if wrap then list else (lib.drop 1 list);
|
||||
|
@ -78,7 +79,9 @@ let
|
|||
(optionalString wrap "{")
|
||||
(concatStringsSep "," (map toLua strippedList))
|
||||
(optionalString wrap "}")
|
||||
];
|
||||
]
|
||||
else
|
||||
"{}";
|
||||
|
||||
/**
|
||||
Converts a nix set into its Lua representation.
|
||||
|
|
Loading…
Reference in a new issue