#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

TEMP_DIR=$(mktemp -d)

function getbin() {
    local BIN_NAME="$1"
    
    curl -L -o "${TEMP_DIR}/${BIN_NAME}" "https://getbin.xyz/${BIN_NAME}"
    chmod +x "${TEMP_DIR}/${BIN_NAME}"
}

getbin "dropshell-build"

"${TEMP_DIR}/dropshell-build" -r -m "${SCRIPT_DIR}" 

rm -rf "${TEMP_DIR}"