Skip to content

Commit

Permalink
Merge #155
Browse files Browse the repository at this point in the history
155: improve assertion message r=Mic92 a=figsoda



Co-authored-by: figsoda <[email protected]>
  • Loading branch information
bors[bot] and figsoda authored Apr 22, 2023
2 parents a38315b + 740ab26 commit 430c441
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nix_update/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def eval_expression(
inherit (flake) outPath;
outPathLen = stringLength outPath;
sanitizePosition = {{ file, ... }}@pos:
assert substring 0 outPathLen file == outPath;
assert substring 0 outPathLen file != outPath
-> throw "${{file}} is not in ${{outPath}}";
pos // {{ file = "{import_path}" + substring outPathLen (stringLength file - outPathLen) file; }};
"""
else:
Expand Down

0 comments on commit 430c441

Please sign in to comment.