some more cleanup
This commit is contained in:
parent
32729c005e
commit
615fe54df1
1 changed files with 6 additions and 2 deletions
|
@ -1,10 +1,14 @@
|
|||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -p typst dmtx-utils nushell -i nu
|
||||
|
||||
def append-if [cond: bool, item: any] {
|
||||
if $cond { $in | append $item } else { $in }
|
||||
}
|
||||
|
||||
def get-chunked-key [keyid?: string] {
|
||||
let flags = [
|
||||
"--export-secret-key", "--export-options", "export-minimal"
|
||||
] | do { if keyid == null { $in } else { $in | append $keyid}}
|
||||
] | append-if ($keyid != null) $keyid
|
||||
let key = (gpg ...$flags)
|
||||
let length = ($key | bytes length)
|
||||
# 1555 is the maximum length in bytes split data evenly
|
||||
|
|
Loading…
Reference in a new issue