use error::Error; use npm; use slog::Logger; use std::result; use PBAR; pub fn login( registry: Option, scope: Option, always_auth: bool, auth_type: Option, log: &Logger, ) -> result::Result<(), Error> { let registry = registry.unwrap_or(npm::DEFAULT_NPM_REGISTRY.to_string()); info!(&log, "Logging in to npm..."); info!( &log, "Scope: {:?} Registry: {}, Always Auth: {}, Auth Type: {:?}.", &scope, ®istry, always_auth, &auth_type ); info!(&log, "npm info located in the npm debug log"); npm::npm_login(®istry, &scope, always_auth, &auth_type)?; info!(&log, "Logged you in!"); PBAR.message(&format!("👋 logged you in!"))?; Ok(()) }