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}.sh" ] || cmd="${dir}/${thisthing}.sh"
|
||||||
[ ! -f "${dir}/${thisthing}" ] || cmd="${dir}/${thisthing}"
|
[ ! -f "${dir}/${thisthing}" ] || cmd="${dir}/${thisthing}"
|
||||||
|
|
||||||
[ -n "$cmd" ] || die "No ${thisthing} script found in $dir"
|
if [ -z "$cmd" ]; then
|
||||||
|
echo "No ${thisthing} script found in $dir"
|
||||||
|
else
|
||||||
echo "Running $cmd"
|
echo "Running $cmd"
|
||||||
"$cmd"
|
"$cmd"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function title() {
|
function title() {
|
||||||
|
@ -13,11 +13,11 @@ die() {
|
|||||||
|
|
||||||
function publish_tool() {
|
function publish_tool() {
|
||||||
local TOOLPATH="$1"
|
local TOOLPATH="$1"
|
||||||
local ARCH="$2"
|
|
||||||
local TOOL;
|
local TOOL;
|
||||||
TOOL=$(basename "$TOOLPATH")
|
TOOL=$(basename "$TOOLPATH")
|
||||||
|
|
||||||
echo "Publishing $TOOL to getbin.xyz"
|
echo "Publishing $TOOL to getbin.xyz"
|
||||||
|
echo "(from $TOOLPATH)"
|
||||||
|
|
||||||
"${TEMP_DIR}/sos" upload "getbin.xyz" "$TOOLPATH" "${TOOL}:latest"
|
"${TEMP_DIR}/sos" upload "getbin.xyz" "$TOOLPATH" "${TOOL}:latest"
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ function publish_executables() {
|
|||||||
|
|
||||||
# Find all dropshell-tool.ARCH files in output/
|
# Find all dropshell-tool.ARCH files in output/
|
||||||
TOOLS=()
|
TOOLS=()
|
||||||
for tool in "${SCRIPT_DIR}/output/"/*dropshell-tool.*; do
|
for tool in "${OUTPUT_DIR}"/*dropshell-tool.*; do
|
||||||
[ -f "$tool" ] || continue
|
[ -f "$tool" ] || continue
|
||||||
tool_name=$(basename "$tool")
|
tool_name=$(basename "$tool")
|
||||||
TOOLS+=("$tool_name")
|
TOOLS+=("$tool_name")
|
||||||
@ -39,21 +39,14 @@ function publish_executables() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for TOOL in "${TOOLS[@]}"; do
|
for TOOL in "${TOOLS[@]}"; do
|
||||||
publish_tool "$TOOL" "${TOOL//dropshell-tool./}"
|
publish_tool "$OUTPUT_DIR/$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"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getbin() {
|
function getbin() {
|
||||||
local BIN_NAME="$1"
|
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}"
|
chmod +x "${TEMP_DIR}/${BIN_NAME}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user