From c21d7e0717cee742fbc57aacf70034188e209005 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 22 Jun 2025 10:18:46 +1200 Subject: [PATCH] 'Generic Commit' --- whatsdirty/publish.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/whatsdirty/publish.sh b/whatsdirty/publish.sh index 37a4c36..091e568 100755 --- a/whatsdirty/publish.sh +++ b/whatsdirty/publish.sh @@ -1,14 +1,30 @@ #!/bin/bash +set -euo pipefail + +function die() { + echo "FATAL:" + echo "$@" + exit 1 +} + + SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +SOS="${SCRIPT_DIR}/../sos/sos" +[ -f "${SOS}" ] || die "Failed to find sos" +GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg" +[ -f "${GETPKG}" ] || die "Failed to find getpkg" + + # run sos to upload -"${SCRIPT_DIR}/../sos/sos" upload "getbin.xyz" "${SCRIPT_DIR}/whatsdirty.sh" "whatsdirty:latest" -"${SCRIPT_DIR}/../sos/sos" upload "getbin.xyz" "${SCRIPT_DIR}/install.sh" "whatsdirty-install:latest" +"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/whatsdirty.sh" "whatsdirty:latest" +"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/install.sh" "whatsdirty-install:latest" # publish the tool +mkdir -p "${SCRIPT_DIR}/tool" +cp "${SCRIPT_DIR}/whatsdirty.sh" "${SCRIPT_DIR}/tool" +ln -s "${SCRIPT_DIR}/tool/whatsdirty.sh" "${SCRIPT_DIR}/tool/whatsdirty" -mkdir -p ${SCRIPT_DIR}/tool -cp ${SCRIPT_DIR}/whatsdirty.sh ${SCRIPT_DIR}/tool -ln -s ${SCRIPT_DIR}/tool/whatsdirty.sh ${SCRIPT_DIR}/tool/whatsdirty - +# publish universal tool. +"${GETPKG}" publish "${SCRIPT_DIR}/tool" "whatsdirty"