Skip to content

Commit

Permalink
Implement situation where variable isn't present
Browse files Browse the repository at this point in the history
If DOWNLOAD_METHOD is not present, it will default to SteamCMD to not break eggs that haven't updated yet.
  • Loading branch information
SturdyStubs authored Aug 10, 2024
1 parent ca1739e commit 004bc12
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions games/carbon/sections/auto_update_validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@ else
Error "/helpers/steamcmd.sh does not exist or cannot be found." "1"
fi

##############################################
# SET DEFAULT DOWNLOAD METHOD IF NOT DEFINED #
##############################################

if [ -z "${DOWNLOAD_METHOD}" ]; then
Warn "DOWNLOAD_METHOD variable not found. Update your egg at https://github.com/SturdyStubs/AIO.Egg. Defaulting to SteamCMD..."
DOWNLOAD_METHOD="SteamCMD"
else
Info "DOWNLOAD_METHOD is set to '${DOWNLOAD_METHOD}'."
fi

#######################################
# CHECK AND INSTALL DEPOTDOWNLOADER IF NEEDED #
#######################################

if [[ "${DOWNLOAD_METHOD}" == "Depot Downloader" ]]; then
Info "Depot Downloader method selected."

# Check if DepotDownloader.dll already exists
if [ -f /home/container/DepotDownloader.dll ]; then
Info "DepotDownloader.dll found. Skipping installation."
else
Info "DepotDownloader.dll 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
unzip DepotDownloader.zip -d /home/container
# Navigate to the DepotDownloader directory
rm -rf /tmp/*
Info "DepotDownloader installation completed successfully."
fi
else
Info "Depot Downloader method not selected. Skipping installation."
fi

#######################################################
# CLEAN RUSTDEDICATED_DATA FOLDER OF OXIDE EXTENSIONS #
#######################################################
Expand Down

0 comments on commit 004bc12

Please sign in to comment.