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.
 
 
Nick Fitzgerald 805b796cf9 Deny missing documentation 7 years ago
..
command Deny missing documentation 7 years ago
bindgen.rs Deny missing documentation 7 years ago
build.rs Deny missing documentation 7 years ago
emoji.rs Deny missing documentation 7 years ago
error.rs Deny missing documentation 7 years ago
lib.rs Deny missing documentation 7 years ago
logger.rs Deny missing documentation 7 years ago
main.rs feat(log): Log information as program runs 7 years ago
manifest.rs Deny missing documentation 7 years ago
npm.rs Deny missing documentation 7 years ago
progressbar.rs Deny missing documentation 7 years ago
readme.rs Deny missing documentation 7 years ago

readme.rs

//! Generating `README` files for the packaged wasm.

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

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

/// Copy the crate's README into the `pkg` directory.
pub fn copy_from_crate(path: &str, step: &Step) -> Result<(), Error> {
let msg = format!("{}Copying over your README...", emoji::DANCERS);
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");
};
Ok(())
}