Skip to content

Commit 740ab26

Browse files
committed
improve assertion message
1 parent 71e0c96 commit 740ab26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nix_update/eval.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def eval_expression(
102102
inherit (flake) outPath;
103103
outPathLen = stringLength outPath;
104104
sanitizePosition = {{ file, ... }}@pos:
105-
assert substring 0 outPathLen file == outPath;
105+
assert substring 0 outPathLen file != outPath
106+
-> throw "${{file}} is not in ${{outPath}}";
106107
pos // {{ file = "{import_path}" + substring outPathLen (stringLength file - outPathLen) file; }};
107108
"""
108109
else:

0 commit comments

Comments
 (0)