Skip to main content

install_plugin

Function install_plugin 

Source
pub fn install_plugin(url: &str)
Expand description

Install a plugin from its github repository. It can also be used to update a plugin if its repository was updated.

§Usage

fmconfig plugin install qkzk/bat_previewer

§Steps

It will successively perform:

  1. parse the author and plugin name from author_plugin, spliting it at the first /
  2. build the repository address which is a temporary folder located at crate::common::REPOSITORIES_PATH
  3. clone the repository in the temporary folder
  4. build the release libso file of the plugin
  5. copy the libso file to its destination crate::common::PLUGIN_LIBSO_PATH and check the result of compilation
  6. add the plugin to the config file in crate::common::CONFIG_PATH
  7. remove the repository folder from temporary files

§Failure

If any step fails (except adding the plugin to config file), it exits with an error printed to stderr.