1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-28 18:47:44 +00:00

nushell: add jc

This commit is contained in:
RGBCube 2025-07-18 21:06:52 +03:00
parent b4919a5990
commit a8cec1de3c
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
2 changed files with 22 additions and 0 deletions

View file

@ -24,6 +24,27 @@ def --env mcg [path: path]: nothing -> nothing {
jj git init --colocate
}
# Run `jc` (JSON Converter).
def --wrapped jc [...arguments]: [any -> table, any -> record, any -> string] {
let run = ^jc ...$arguments | complete
if $run.exit_code != 0 {
error make {
msg: $run.stderr,
label: {
text: "jc execution failed",
span: (metadata $arguments).span
}
}
}
if "--help" in $arguments or "-h" in $arguments {
$run.stdout
} else {
$run.stdout | from json
}
}
# `nu-highlight` with default colors
#
# Custom themes can produce a lot more ansi color codes and make the output

View file

@ -14,6 +14,7 @@ in {
fastfetch
fd
hyperfine
jc
moreutils
openssl
p7zip