'Generic Commit'
All checks were successful
Build-Test-Publish / build (push) Successful in 20s

This commit is contained in:
Your Name 2025-06-22 10:25:51 +12:00
parent 33387bdc35
commit 4e0c476ccb
2 changed files with 20 additions and 14 deletions

32
sos/sos
View File

@ -5,15 +5,24 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
TEMP_DIR=$(mktemp -d)
trap 'rm -rf "${TEMP_DIR}"' EXIT
# get getpkg
GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg"
if [ ! -f "${GETPKG}" ]; then
ARCH=$(uname -m)
curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" || die "Failed to download getpkg"
chmod +x "${TEMP_DIR}/getpkg"
GETPKG="${TEMP_DIR}/getpkg"
fi
function die() {
echo "FATAL:"
echo "$@"
exit 1
}
function get_getpkg() {
# get getpkg
export GETPKG="${SCRIPT_DIR}/../getpkg/output/getpkg"
if [ ! -f "${GETPKG}" ]; then
ARCH=$(uname -m)
curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" || die "Failed to download getpkg"
chmod +x "${TEMP_DIR}/getpkg"
GETPKG="${TEMP_DIR}/getpkg"
[ -f "${GETPKG}" ] || die "Failed to download getpkg"
fi
}
function show_help() {
cat << EOF
@ -36,11 +45,6 @@ EOF
exit 0
}
function die() {
echo "FATAL:"
echo "$@"
exit 1
}
function datetime() {
date -u +"%Y.%m%d.%H%M"
@ -157,6 +161,8 @@ EOF
CMD="$1"
shift
get_getpkg
if [ "$CMD" == "upload" ]; then
upload "$@"
exit $?

View File

@ -27,4 +27,4 @@ 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"
#"${GETPKG}" publish "${SCRIPT_DIR}/tool" "whatsdirty"