|
|
@ -9,13 +9,14 @@ pub fn pack(path: Option<String>, log: &Logger) -> result::Result<(), Error> { |
|
|
|
let crate_path = set_crate_path(path); |
|
|
|
let crate_path = set_crate_path(path); |
|
|
|
|
|
|
|
|
|
|
|
info!(&log, "Packing up the npm package..."); |
|
|
|
info!(&log, "Packing up the npm package..."); |
|
|
|
match npm::npm_pack(&crate_path) { |
|
|
|
npm::npm_pack(&crate_path).map_err(|e| { |
|
|
|
Ok(r) => Ok(r), |
|
|
|
match e { |
|
|
|
Err(Error::Io { .. }) => Err(Error::DirNotFound { |
|
|
|
Error::Io { .. } => Error::PkgNotFound { |
|
|
|
message: "Unable to find the pkg directory".to_owned(), |
|
|
|
message: format!("Unable to find the pkg directory at path '{}', set the path as the parent directory of the pkg directory", &crate_path), |
|
|
|
}), |
|
|
|
}, |
|
|
|
Err(e) => Err(e), |
|
|
|
e => e, |
|
|
|
}?; |
|
|
|
} |
|
|
|
|
|
|
|
})?; |
|
|
|
#[cfg(not(target_os = "windows"))] |
|
|
|
#[cfg(not(target_os = "windows"))] |
|
|
|
info!(&log, "Your package is located at {}/pkg", &crate_path); |
|
|
|
info!(&log, "Your package is located at {}/pkg", &crate_path); |
|
|
|
#[cfg(target_os = "windows")] |
|
|
|
#[cfg(target_os = "windows")] |
|
|
|