diff --git a/apps/nogui/nushell.nix b/apps/nogui/nushell.nix index 53a11fe1cea4e81a534e3374256b656f22c87630..2db332f10de911301df90a8112636d640532f7d3 100644 --- a/apps/nogui/nushell.nix +++ b/apps/nogui/nushell.nix @@ -36,6 +36,5 @@ "nushell/miniserve.nu".source = ./nushell/miniserve.nu; "nushell/clone.nu".source = ./nushell/clone.nu; "nushell/git-bug.nu".source = ./nushell/git-bug.nu; "nushell/ohmyposh.nu".source = ./nushell/ohmyposh.nu; - "nushell/tangled.nu".source = ./nushell/tangled.nu; }; } diff --git a/apps/nogui/nushell/jolheiser.nu b/apps/nogui/nushell/jolheiser.nu index 4bee4267c92f68640da62d8b638a49853b158dd2..ca78e1333810165b32f9854664ce7b4a79209893 100644 --- a/apps/nogui/nushell/jolheiser.nu +++ b/apps/nogui/nushell/jolheiser.nu @@ -64,4 +64,3 @@ source ~/.config/nushell/ssh.nu source ~/.config/nushell/miniserve.nu source ~/.config/nushell/clone.nu source ~/.config/nushell/git-bug.nu -source ~/.config/nushell/tangled.nu diff --git a/apps/nogui/nushell/tangled.nu b/apps/nogui/nushell/tangled.nu deleted file mode 100644 index 7ef73c0326ff8eef5f890da57c5603680ee32c5c..0000000000000000000000000000000000000000 --- a/apps/nogui/nushell/tangled.nu +++ /dev/null @@ -1,53 +0,0 @@ -# Strings CLI -# -# Examples: -# $ string main.go -# $ echo "Hey tanglers!" | string --title "tanglers.txt" --description "A file for all the tanglers" -export def string [ - file?: path # File to create string from, otherwise stdin - --title (-t): string # Title of the string (default is filename when file is provided, otherwise random uuid) - --description (-d): string # Description of the string -]: [ - path -> string - nothing -> string -] { - mut _content = $in - mut _title = (random uuid) - if ($file != null) { - $_content = ($file | open --raw | decode utf-8) - $_title = ($file | path basename) - } - if ($title != null) { - $_title = $title - } - mut _desc = "" - if ($description != null) { - $_desc = $description - } - - let payload = ({ - "$type": "sh.tangled.string", - "contents": $_content, - "filename": $_title, - "createdAt": (date now | format date "%Y-%m-%dT%H:%M:%SZ"), - "description": $_desc - } | to json) - - let tmp = (mktemp --tmpdir sh.tangled.string.XXX) - - $payload | save --force $tmp - - mut out = "" - try { - let resp = (^goat record create --no-validate $tmp) - # at://did:plc:35kdk2ntcs626zs6cm62i7ih/sh.tangled.string/3lxuash7vvc2f bafyreifv7c6il2zsa67oa6umutb52izbgrnmz336wzbgti2we3tpw3bcj4 - # 0 1 2 3 4 5 6 7 8 - let plc = ($resp | split words | get 3) - let rkey = ($resp | split words | get 7) - $out = $"https://tangled.sh/strings/did:plc:($plc)/($rkey)" - } - - rm $tmp - - $out -}