pub fn install(url: String) -> Result<(), String> {
    if let Ok(mut script) = Downloader::download_script(url.clone()) {
        println!("Installing rapture script at '{}'", url);
        match script.run() {
            Ok(_) => Ok(()),
            Err(e) => {
                println!("There was a problem installing the package: {}", e);
                let new_manager = backup::installer_name();
                if yes_or_no(format!("Do you want to try to install your package using {}? (y/n) ", new_manager)) {
                    let package_name = input(format!("What's the name of the package you want to install with {}? ", new_manager));
                    backup::install(package_name)?;
                }
                Ok(())
            }
        }
    } else {
        Ok(())
    }
}
/// Downloads a script from the given url and runs it.
/// If there was an error running the install script, 
/// Ask the user if they want to install using their native
/// package manager.
Downloads a script from the given url and runs it.
If there was an error running the install script,
Ask the user if they want to install using their native
package manager.
Downloads a script from the given url and runs it . If there was an error running the install script Ask the user if they want to install using their native package manager .
pub fn install(url: String) -> Result<(), String> {
    if let Ok(mut script) = Downloader::download_script(url.clone()) {
        println!("Installing rapture script at '{}'", url);
        match script.run() {
            Ok(_) => Ok(()),
            Err(e) => {
                println!("There was a problem installing the package: {}", e);
                let new_manager = backup::installer_name();
                if yes_or_no(format!("Do you want to try to install your package using {}? (y/n) ", new_manager)) {
                    let package_name = input(format!("What's the name of the package you want to install with {}? ", new_manager));
                    backup::install(package_name)?;
                }
                Ok(())
            }
        }
    } else {
        Ok(())
    }
}
pub fn install ( url : String ) -> Result < ( ) , String > { if let Ok ( mut script ) = Downloader :: download_script ( url . clone ( ) ) { println ! ( " " url ) ; match script . run ( ) { Ok ( _ ) => Ok ( ( ) ) , Err ( e ) => { println ! ( " " e ) ; let new_manager = backup :: installer_name ( ) ; if yes_or_no ( format ! ( " " new_manager ) ) { let package_name = input ( format ! ( " " new_manager ) ) ; backup :: install ( package_name ) ? ; } Ok ( ( ) ) } } } else { Ok ( ( ) ) } }
Downloads a script from the given url and runs it.
Downloads a script from the given url and runs it .
url
String
url
String