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.
 
 
Michael Gattozzi cf8d95f421
feat(rustfmt): Run rustfmt fixes
8 years ago
..
bindgen.rs feat(rustfmt): Run rustfmt fixes 8 years ago
build.rs feat(rustfmt): Run rustfmt fixes 8 years ago
command.rs feat(rustfmt): Run rustfmt fixes 8 years ago
emoji.rs fix(output): refactor 8 years ago
lib.rs feat(refactor/early abort): Exit early on failure 8 years ago
main.rs feat(rustfmt): Run rustfmt fixes 8 years ago
manifest.rs feat(rustfmt): Run rustfmt fixes 8 years ago
npm.rs feat(rustfmt): Run rustfmt fixes 8 years ago
progressbar.rs feat(pbar): Add global progress bar to write to 8 years ago
readme.rs feat(rustfmt): Run rustfmt fixes 8 years ago

readme.rs

use console::style;
use failure::Error;
use std::fs;

use PBAR;
use emoji;

pub fn copy_from_crate(path: &str) -> Result<(), Error> {
let step = format!(
"{} {}Copying over your README...",
style("[5/7]").bold().dim(),
emoji::DANCERS
);
let pb = PBAR.message(&step);
let crate_readme_path = format!("{}/README.md", path);
let new_readme_path = format!("{}/pkg/README.md", path);
if let Err(_) = fs::copy(&crate_readme_path, &new_readme_path) {
PBAR.warn("origin crate has no README");
};
pb.finish();
Ok(())
}