Skip to content

Commit

Permalink
archive fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
SturdyStubs committed Oct 25, 2024
1 parent bf8a1c6 commit fbc522e
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions games/carbon/sections/auto_update_validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,19 @@ fi

if [[ "${DOWNLOAD_METHOD}" == "Depot Downloader" ]]; then
DEPOTDOWNLOADER_DIR="/home/container/DepotDownloader"

# Check if DepotDownloader already exists
if [ -f "${DEPOTDOWNLOADER_DIR}" ]; then
echo "DepotDownloader found. Checking for updates..."

# Get the current installed version using the -version tag
INSTALLED_VERSION=$(${DEPOTDOWNLOADER_DIR} -version 2>&1 | grep -oP '\d+\.\d+\.\d+')

# Get the latest release version from GitHub
LATEST_VERSION=$(curl -s https://api.github.com/repos/SteamRE/DepotDownloader/releases/latest | grep 'tag_name' | cut -d '"' -f 4 | sed 's/DepotDownloader_//')

echo "Installed version: $INSTALLED_VERSION"
echo "Latest version: $LATEST_VERSION"

if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
echo "Newer version available. Updating DepotDownloader..."

# Create a temporary directory for download
cd /tmp

# Download the latest version of DepotDownloader
curl -sSL -o DepotDownloader.zip https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_${LATEST_VERSION}/DepotDownloader-linux-x64.zip

# Unzip the DepotDownloader package to /home/container
if unzip DepotDownloader.zip -d /home/container; then
# Clean up temporary files
if unzip -o DepotDownloader.zip -d /home/container; then
rm -rf /tmp/*

# Set permissions
chmod +x /home/container/DepotDownloader

Warn "DepotDownloader updated to version $LATEST_VERSION. We need to restart your system in order to complete the install..."
exit 0
else
Expand All @@ -73,21 +55,11 @@ if [[ "${DOWNLOAD_METHOD}" == "Depot Downloader" ]]; then
fi
else
echo "DepotDownloader not found. Installing DepotDownloader..."

# Create a temporary directory for download
cd /tmp

# Download DepotDownloader from the provided URL
curl -sSL -o DepotDownloader.zip https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.6.0/DepotDownloader-linux-x64.zip

# Unzip the DepotDownloader package to /home/container
if unzip DepotDownloader.zip -d /home/container; then
# Set permissions
if unzip -o DepotDownloader.zip -d /home/container; then
chmod +x /home/container/DepotDownloader

# Clean up temporary files
rm -rf /tmp/*

Warn "DepotDownloader installation completed successfully. We need to restart your system in order to complete the install..."
exit 0
else
Expand Down

0 comments on commit fbc522e

Please sign in to comment.