blob: 34a775ba2b36c0a61f8475aae4e8e9c5c3409c33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
{
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
}
} | null
if ($iota_paths == []) {
print "No inbox items!"
}
''
|