From c33ca6f4b477151ae5facc0f8b12345a41164e98 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 30 May 2025 19:02:32 +1200 Subject: [PATCH] :-'Generic Commit' --- README.md | 2 +- dropshell-tool-install.sh | 11 +++++++++++ publish_all.sh | 15 +++++++++++++++ sos/sos | 24 ++++++++++++++++++------ 4 files changed, 45 insertions(+), 7 deletions(-) create mode 100755 dropshell-tool-install.sh mode change 100644 => 100755 publish_all.sh diff --git a/README.md b/README.md index dca9ec6..19eee8c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Tools are installed to ~/.local/bin/dropshell-tool, and the tool name is added t Just use dropshell-tool. You can install with: ``` -curl https://getbin.xyz/dropshell-tool:latest +curl https://getbin.xyz/dropshell-tool-install.sh | bash ``` diff --git a/dropshell-tool-install.sh b/dropshell-tool-install.sh new file mode 100755 index 0000000..3a0f39f --- /dev/null +++ b/dropshell-tool-install.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euo pipefail + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + + + + + + diff --git a/publish_all.sh b/publish_all.sh old mode 100644 new mode 100755 index 73b952a..7cafb37 --- a/publish_all.sh +++ b/publish_all.sh @@ -1,5 +1,20 @@ #!/bin/bash +set -euo pipefail + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + + +# run sos to upload dropshell-tool-install.sh +"${SCRIPT_DIR}/sos/sos" upload "${SCRIPT_DIR}/dropshell-tool-install.sh" "dropshell-tool-install.sh" + + +# build and publish all dropshell tools + + + + + # build and publish all dropshell tools diff --git a/sos/sos b/sos/sos index 97fe2ca..cb9ef49 100755 --- a/sos/sos +++ b/sos/sos @@ -49,20 +49,32 @@ function upload() { [ -f "$file" ] || die "File not found: $file" - # if the label doesn't have a tag, add :lastest - if [[ ! "$label" =~ : ]]; then - label="$label:latest" - fi # upload the file TARGET_URL="https://$server/upload" echo "Uploading $file to $TARGET_URL" + DATETIME=$(datetime) + + # if the label doesn't have a tag, add :lastest + [[ "$label" =~ : ]] || label="$label:latest" + label_base=$(echo "$label" | cut -d':' -f1) + + LABELTAGS=( + "$label" + "$label_base:$DATETIME" + "$label_base:latest" + ) + # deduplicate the labeltags + mapfile -t LABELTAGS < <(printf "%s\n" "${LABELTAGS[@]}" | sort -u) + LABELTAGS_JSON=$(printf '"%s",' "${LABELTAGS[@]}") + LABELTAGS_JSON="[${LABELTAGS_JSON%,}]" + METADATA_JSON=$(cat <