Skip to content

Commit

Permalink
scripts: improve modloader download
Browse files Browse the repository at this point in the history
  • Loading branch information
bredo228 committed Jul 15, 2024
1 parent 9b00dd4 commit 6e9043d
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions scripts/update-resonite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@ if [ "${ENABLE_MODS}" = "true" ]; then
mkdir -p /RML/rml_mods /RML/rml_libs /RML/rml_config

# Symlink rml_mods, rml_libs and rml_config to where Resonite will read them.
ln -sf /RML/rml_mods ${HEADLESS_DIRECTORY}/rml_mods
ln -sf /RML/rml_libs ${HEADLESS_DIRECTORY}/rml_libs
ln -sf /RML/rml_config ${HEADLESS_DIRECTORY}/rml_config

# From: https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8?permalink_comment_id=5097031#gistcomment-5097031
# Fetch the latest release version number for ResoniteModLoader
latest_version=$(curl -s https://api.github.com/repos/resonite-modding-group/ResoniteModLoader/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
# Remove the 'v' prefix from the version number
version=${latest_version#v}
# Construct the download URLs for RML and Harmony
harmonydll_url="https://github.com/resonite-modding-group/ResoniteModLoader/releases/download/${latest_version}/0Harmony-Net8.dll"
rmldll_url="https://github.com/resonite-modding-group/ResoniteModLoader/releases/download/${latest_version}/ResoniteModLoader.dll"
#Download the required DLLs
curl -L -o "rml_libs/0Harmony-Net8.dll" "$harmonydll_url"
curl -L -o "Libraries/ResoniteModLoader.dll" "$rmldll_url"
ln -s /RML/rml_mods ${HEADLESS_DIRECTORY}/rml_mods
ln -s /RML/rml_libs ${HEADLESS_DIRECTORY}/rml_libs
ln -s /RML/rml_config ${HEADLESS_DIRECTORY}/rml_config

# Download RML and 0harmony
curl -SslL https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony-Net8.dll -o ${HEADLESS_DIRECTORY}/rml_libs/0Harmony-Net8.dll
curl -SslL https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll -o ${HEADLESS_DIRECTORY}/Libraries/ResoniteModLoader.dll

fi

0 comments on commit 6e9043d

Please sign in to comment.