diff --git a/buildtestpublish_all.sh b/buildtestpublish_all.sh index 03067fe..faa3b50 100755 --- a/buildtestpublish_all.sh +++ b/buildtestpublish_all.sh @@ -11,10 +11,12 @@ function dothis() { [ ! -f "${dir}/${thisthing}.sh" ] || cmd="${dir}/${thisthing}.sh" [ ! -f "${dir}/${thisthing}" ] || cmd="${dir}/${thisthing}" - [ -n "$cmd" ] || die "No ${thisthing} script found in $dir" - - echo "Running $cmd" - "$cmd" + if [ -z "$cmd" ]; then + echo "No ${thisthing} script found in $dir" + else + echo "Running $cmd" + "$cmd" + fi } function title() { diff --git a/dropshell-tool/publish.sh b/dropshell-tool/publish.sh index 3876f36..1605495 100755 --- a/dropshell-tool/publish.sh +++ b/dropshell-tool/publish.sh @@ -13,11 +13,11 @@ die() { function publish_tool() { local TOOLPATH="$1" - local ARCH="$2" local TOOL; TOOL=$(basename "$TOOLPATH") echo "Publishing $TOOL to getbin.xyz" + echo "(from $TOOLPATH)" "${TEMP_DIR}/sos" upload "getbin.xyz" "$TOOLPATH" "${TOOL}:latest" } @@ -27,7 +27,7 @@ function publish_executables() { # Find all dropshell-tool.ARCH files in output/ TOOLS=() - for tool in "${SCRIPT_DIR}/output/"/*dropshell-tool.*; do + for tool in "${OUTPUT_DIR}"/*dropshell-tool.*; do [ -f "$tool" ] || continue tool_name=$(basename "$tool") TOOLS+=("$tool_name") @@ -39,21 +39,14 @@ function publish_executables() { fi for TOOL in "${TOOLS[@]}"; do - publish_tool "$TOOL" "${TOOL//dropshell-tool./}" - - # extract the architecture from the tool name - ARCH="${TOOL//dropshell-tool./}" - - # upload the tool - "${SCRIPT_DIR}/../sos/sos" upload "getbin.xyz" "dropshell-tool:${ARCH}" "$OUTPUT_DIR/$TOOL" + publish_tool "$OUTPUT_DIR/$TOOL" done - } function getbin() { local BIN_NAME="$1" - curl -L -o "${TEMP_DIR}/${BIN_NAME}" "https://getbin.xyz/${BIN_NAME}" + curl -L -s -o "${TEMP_DIR}/${BIN_NAME}" "https://getbin.xyz/${BIN_NAME}" || die "Failed to download ${BIN_NAME}" chmod +x "${TEMP_DIR}/${BIN_NAME}" }