diff options
Diffstat (limited to 'pkgs/inbox-review.nix')
| -rw-r--r-- | pkgs/inbox-review.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/inbox-review.nix b/pkgs/inbox-review.nix new file mode 100644 index 0000000..a65cd06 --- /dev/null +++ b/pkgs/inbox-review.nix @@ -0,0 +1,27 @@ +{ + pkgs +}: let + inbox = "~/Sync/vault/inbox"; +in pkgs.writers.writeNuBin "inboxreview" /*nu*/ '' + let inbox = "${inbox}" | path expand + + let iota_paths = ls $inbox | get name + + $iota_paths | each {|path| + let contents = $path | open + + print $"\n(ansi purple)($contents)(ansi reset)\n" + + let deletion_confirmation = match (input "Delete? [Y/n] ") { + "" => true, + "Y" => true, + "y" => true, + "n" => false, + _ => false, + } + + if $deletion_confirmation { + rm $path + } + } +'' |
