A server/library combo for updating skyline plugins written in Rust.
// Get a stable update of plugin "plugin_name" from IP `127.0.0.1` using the version in `Cargo.toml` to display the version of the current plugin
skyline_update::check_update("127.0.0.1".parse().unwrap(), "plugin_name", env!("CARGO_PKG_VERSION"), false);
Simply run the server in the background on the IP specified in the plugin. Plugins are located in the plugins
folder of the current working directory. The structure of a plugin looks like so:
plugins
L my_mod_name
L plugin.toml
L my_mod_name.nro
L my_mod_file_dependency.txt
Things to note:
- Each plugin is a subdirectory in the plugins folder (the name of the folder can be anything)
- Each plugin folder must contain a
plugin.toml
- Each plugin folder should contain any other relevant files needed to be served
A plugin.toml
looks like so:
version = "1.0.0"
name = "my_mod_name"
files = [
{ install_location = "sd:/atmosphere/contents/01006A800016E000/exefs/my_mod_name.nro", filename = "my_mod_name.nro" },
{ install_location = "sd:/my_mod_file_dependency.txt", filename = "my_mod_file_dependency.txt" }
]
version
- string, a valid semver version string representing the version of the plugin currently present in the folder. It is highly recommended this match yourCargo.toml
of your plugin. Updates will only be shown to users if a newer version is present on the server.name
- string, an identifier for your plugin. Must match the name provided inskyline_update::check_update
, otherwise the plugin will not be found when attempting to update.files
- A list of files to be installed if the user chooses to update.install_location
- where on the switch's SD card to install the updatefilename
- name of the file in the server. If the path is relative, it will be relative to the plugin folder.
skyline_version
(optional) - Minimum skyline version to use. Will update to the server's skyline if the current one is too low. (Currently supported)beta
(optional) - Whether or not to treat this plugin as a beta version. The server can have multiple copies of the same plugin, however the highest version will always be installed. Whether or not beta versions are included is based on the boolean passed toskyline_update::check_update
. If the stable version of a plugin has a higher version than the beta, . Defaults tofalse
.
An example setup of the plugin server can be found in update-server/plugins
. It contains a single plugin with both a stable and a beta branch.