RustDedicated/download-references.sh
2025-12-05 19:10:39 +10:30

42 lines
996 B
Bash
Executable file

#!/bin/bash
if ! command -v "depotdownloader" > /dev/null; then
echo "error: missing depotdownloader binary"
exit 1
fi
if [[ ! -d ".references" ]]; then
mkdir .references
fi
cd .references || exit 1
function download_rust() {
if [[ ! -d "RustDedicated_Data" ]]; then
cat << EOF > filelist.txt
regex:RustDedicated_Data/Managed/.+\.dll
EOF
echo "Downloading RustDedicated..."
depotdownloader -app 258550 -branch release -dir . -filelist filelist.txt
else
echo "Skipped RustDedicated download as RustDedicated_Data already exists."
fi
}
function download_carbon() {
if [[ ! -f "carbon.tar.gz" ]]; then
echo "Downloading Carbon..."
curl -JL -o carbon.tar.gz https://github.com/CarbonCommunity/Carbon/releases/download/production_build/Carbon.Linux.Release.tar.gz
echo "Extracting Carbon..."
tar -xvf carbon.tar.gz
echo "Done!"
else
echo "Skipped Carbon extraction as carbon.tar.gz already exists."
fi
}
download_rust
download_carbon