Skip to content

Commit

Permalink
Add Nix package that silently falls back to cat on error
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrenierejm committed Sep 7, 2023
1 parent 3b27f1a commit f69ed58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
packages = {
inherit gron;
default = gron;
gronWithFallback = pkgs.writeShellApplication {
name = "gron-with-fallback";
runtimeInputs = [ gron ];
text = ''
gron "$1" 2>/dev/null || cat "$1"
'';
};
};

apps.default = gron;
Expand Down

0 comments on commit f69ed58

Please sign in to comment.