install_package

Function install_package 

Source
pub fn install_package(
    package_manager: &PackageManager,
    package: &str,
) -> Result<(), Box<dyn Error>>
Expand description

Installs a package using the specified package manager.

This function runs the appropriate install command for the given package manager.

§Arguments

  • package_manager - A reference to the PackageManager enum representing the system’s package manager.
  • package - A string slice containing the name of the package to install.

§Returns

Returns a Result indicating success or an error if the installation process fails.