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.
 
 
wasm-pack/src/command/login.rs

24 lines
622 B

use crate::npm;
use crate::PBAR;
use anyhow::Result;
use log::info;
pub fn login(
registry: Option<String>,
scope: &Option<String>,
auth_type: &Option<String>,
) -> Result<()> {
let registry = registry.unwrap_or_else(|| npm::DEFAULT_NPM_REGISTRY.to_string());
info!("Logging in to npm...");
info!(
"Scope: {:?} Registry: {}, Auth Type: {:?}.",
&scope, &registry, &auth_type
);
info!("npm info located in the npm debug log");
npm::npm_login(&registry, &scope, &auth_type)?;
info!("Logged you in!");
PBAR.info(&"👋 logged you in!".to_string());
Ok(())
}