From bca296334f0c2b5228267bd8ed779533f420a774 Mon Sep 17 00:00:00 2001 From: Nico Date: Sat, 3 May 2025 16:16:01 +1000 Subject: [PATCH] zsh: allow uploading directories via 0x0 function --- stow/.zshrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stow/.zshrc b/stow/.zshrc index 2572151..a468ff6 100644 --- a/stow/.zshrc +++ b/stow/.zshrc @@ -47,7 +47,14 @@ func calc() { } func 0x0() { - curl -F file=@$1 https://0x0.st + if [ -d "$1" ]; + then + TMPFILE="$(mktemp)" + tar cf "$TMPFILE" "$1" + curl -F file=@$TMPFILE -F expires=24 https://0x0.st + else + curl -F file=@$1 -F expires=24 https://0x0.st + fi } # plugins