chore: change warning message
This commit is contained in:
parent
e980b4d450
commit
a45e0eee22
1 changed files with 3 additions and 4 deletions
7
lib.nix
7
lib.nix
|
@ -18,8 +18,9 @@ let
|
||||||
inherit (builtins) isString isFloat isInt isBool isList isAttrs isNull isPath;
|
inherit (builtins) isString isFloat isInt isBool isList isAttrs isNull isPath;
|
||||||
inherit (builtins) concatStringsSep filter mapAttrs attrValues;
|
inherit (builtins) concatStringsSep filter mapAttrs attrValues;
|
||||||
|
|
||||||
# Source: https://github.com/NixOS/nixpkgs/blob/12f0044f83517e653d0b4fe12a99d162d9407437/lib/trivial.nix#L357
|
error = message: throw "[nix2lua] ${message}";
|
||||||
warn = msg: builtins.trace "[1;31mwarning: ${msg}[0m";
|
|
||||||
|
warn = msg: builtins.trace "[nix2lua] warning: ${msg}";
|
||||||
|
|
||||||
mkLuaRaw = raw: { _type = "raw"; inherit raw; };
|
mkLuaRaw = raw: { _type = "raw"; inherit raw; };
|
||||||
isLuaRaw = expr: getType expr == "raw";
|
isLuaRaw = expr: getType expr == "raw";
|
||||||
|
@ -75,8 +76,6 @@ let
|
||||||
validString = expr:
|
validString = expr:
|
||||||
if isString expr || isPath expr then toString expr
|
if isString expr || isPath expr then toString expr
|
||||||
else error "Value '${toString expr}' is not a valid string";
|
else error "Value '${toString expr}' is not a valid string";
|
||||||
|
|
||||||
error = message: throw "[nix2lua] ${message}";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit toLua;
|
inherit toLua;
|
||||||
|
|
Loading…
Reference in a new issue