fork of https://github.com/rustwasm/wasm-pack for the needs of NextGraph.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
772 B
31 lines
772 B
use error::Error;
|
|
use npm;
|
|
use slog::Logger;
|
|
use std::result;
|
|
use PBAR;
|
|
|
|
pub fn login(
|
|
registry: Option<String>,
|
|
scope: Option<String>,
|
|
always_auth: bool,
|
|
auth_type: Option<String>,
|
|
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(())
|
|
}
|
|
|