Skip to content

Commit 66ae24b

Browse files
Pegasustblaggacao
authored andcommitted
feat(blocktypes/namaka): allow overriding of subdir
This allows you to put in {snapshots = {meta.description="your desc"; check = namaka.lib.load {...}; snap-dir = "nix";} This is so that if your repo wants to have everything nix (apart from flake.nix) to be in nix/ or contrib/, maybe via some kind of code ownership system, you can have these snapshots inside
1 parent 46878a2 commit 66ae24b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/std/fwlib/blockTypes/namaka.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ in
1717
inputs,
1818
}: let
1919
pkg = inputs.namaka.packages.${currentSystem}.default;
20+
subdir = target.snap-dir or "";
2021
in [
2122
(mkCommand currentSystem "eval" "use transparently with namaka cli" [] ''
2223
nix eval '.#${fragment}.check'
2324
'' {})
2425
(mkCommand currentSystem "check" "run namaka tests against snapshots" [pkg] ''
25-
namaka check -c nix eval '.#${fragment}.check'
26+
namaka ${subdir} check -c nix eval '.#${fragment}.check'
2627
'' {})
2728
(mkCommand currentSystem "review" "review pending namaka checks" [pkg] ''
28-
namaka review -c nix eval '.#${fragment}.check'
29+
namaka ${subdir} review -c nix eval '.#${fragment}.check'
2930
'' {})
3031
(mkCommand currentSystem "clean" "clean up pending namaka checks" [pkg] ''
31-
namaka clean -c nix eval '.#${fragment}.check'
32+
namaka ${subdir} clean -c nix eval '.#${fragment}.check'
3233
'' {})
3334
];
3435
}

0 commit comments

Comments
 (0)