From f8a691269f2272451e797f50c1fa793420860f01 Mon Sep 17 00:00:00 2001 From: Jack Back Date: Tue, 26 Mar 2024 17:58:36 +0100 Subject: [PATCH] AI did this --- .gitea/scripts/ci.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitea/scripts/ci.sh b/.gitea/scripts/ci.sh index d1ef0d3..0871738 100755 --- a/.gitea/scripts/ci.sh +++ b/.gitea/scripts/ci.sh @@ -5,3 +5,31 @@ if [[ -z "$OAT_VERSION" ]]; then echo "No OAT version was specified, please set the OAT_VERSION environment variable." exit 1 fi + +# Construct the download URL +DOWNLOAD_URL="https://github.com/Laupetin/OpenAssetTools/releases/download/v${OAT_VERSION}/oat-linux.tar.gz" + +echo "Downloading OAT from: $DOWNLOAD_URL" + +# Define temporary directory +TEMP_DIR="/tmp/oat_download" + +# Create temporary directory if it doesn't exist +mkdir -p "$TEMP_DIR" + +# Download the tar.gz file to the temporary directory +curl -L -o "${TEMP_DIR}/oat-linux.tar.gz" "$DOWNLOAD_URL" + +# Extract the contents of the tar.gz file +tar -xzf "${TEMP_DIR}/oat-linux.tar.gz" -C "${TEMP_DIR}" + +# Copy the executables to /usr/local/bin and make them executable +sudo cp "${TEMP_DIR}/Linker" "${TEMP_DIR}/Unliker" /usr/local/bin/ +sudo chmod +x /usr/local/bin/Linker /usr/local/bin/Unliker + +# Clean up temporary directory +rm -rf "$TEMP_DIR" + +echo "OpenAssetTools version $OAT_VERSION has been installed." + +Linker --help