Skip to content

Commit

Permalink
feat(blocktypes/namaka): allow overriding of subdir
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Pegasust authored and blaggacao committed Sep 3, 2023
1 parent 46878a2 commit 66ae24b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/std/fwlib/blockTypes/namaka.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ in
inputs,
}: let
pkg = inputs.namaka.packages.${currentSystem}.default;
subdir = target.snap-dir or "";
in [
(mkCommand currentSystem "eval" "use transparently with namaka cli" [] ''
nix eval '.#${fragment}.check'
'' {})
(mkCommand currentSystem "check" "run namaka tests against snapshots" [pkg] ''
namaka check -c nix eval '.#${fragment}.check'
namaka ${subdir} check -c nix eval '.#${fragment}.check'
'' {})
(mkCommand currentSystem "review" "review pending namaka checks" [pkg] ''
namaka review -c nix eval '.#${fragment}.check'
namaka ${subdir} review -c nix eval '.#${fragment}.check'
'' {})
(mkCommand currentSystem "clean" "clean up pending namaka checks" [pkg] ''
namaka clean -c nix eval '.#${fragment}.check'
namaka ${subdir} clean -c nix eval '.#${fragment}.check'
'' {})
];
}

0 comments on commit 66ae24b

Please sign in to comment.