This commit is contained in:
parent
2ec025888b
commit
da82558722
@ -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() {
|
||||
|
@ -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}"
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user