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.
 
 
Robert Masen 5e8f723665 Add nightly toolchain to commands 7 years ago
..
bindgen.rs Add --skip-build flag for init command 7 years ago
build.rs Add nightly toolchain to commands 7 years ago
command.rs Add test of --skip-build 7 years ago
emoji.rs Add nightly toolchain to commands 7 years ago
error.rs feat(wasm_bindgen): checks wasm-bindgen declaration in Cargo.toml 7 years ago
lib.rs feat(log): Log information as program runs 7 years ago
logger.rs fix(logger): if no path, append wasm-pack.log to current dir 7 years ago
main.rs feat(log): Log information as program runs 7 years ago
manifest.rs Add --skip-build flag for init command 7 years ago
npm.rs add default npm repo to codebase and always pass it as a param 8 years ago
progressbar.rs Add --skip-build flag for init command 7 years ago
readme.rs Add --skip-build flag for init command 7 years ago

readme.rs

use error::Error;
use std::fs;

use emoji;
use progressbar::Step;
use PBAR;

pub fn copy_from_crate(path: &str, step: &Step) -> Result<(), Error> {
let msg = format!("{}Copying over your README...", emoji::DANCERS);
let pb = PBAR.step(step, &msg);
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(())
}