VLAarchtests / code /reveal_vla_bimanual /scripts /download_coppeliasim.sh
lsnu's picture
Add files using upload-large-folder tool
6fa1956 verified
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="${ROOT_DIR:-/workspace}"
ASSET_DIR="${ROOT_DIR}/assets"
INSTALL_DIR="${ASSET_DIR}/coppeliasim_v4_1_0"
ARCHIVE_URL="${ARCHIVE_URL:-https://downloads.coppeliarobotics.com/V4_1_0/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz}"
ARCHIVE_PATH="${ASSET_DIR}/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04.tar.xz"
download() {
local url="$1"
local output="$2"
if curl -L "${url}" -o "${output}"; then
return 0
fi
if curl -k -L "${url}" -o "${output}"; then
return 0
fi
wget --no-check-certificate "${url}" -O "${output}"
}
mkdir -p "${ASSET_DIR}" "${INSTALL_DIR}"
if [[ -f "${INSTALL_DIR}/coppeliaSim.sh" ]]; then
echo "${INSTALL_DIR}"
exit 0
fi
if [[ ! -f "${ARCHIVE_PATH}" ]]; then
download "${ARCHIVE_URL}" "${ARCHIVE_PATH}"
fi
rm -rf "${INSTALL_DIR}"
mkdir -p "${INSTALL_DIR}"
tar --no-same-owner --no-same-permissions -xf "${ARCHIVE_PATH}" -C "${INSTALL_DIR}" --strip-components 1
echo "${INSTALL_DIR}"