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.
 
 
ashley williams 8f2682a3ee
Merge pull request #134 from mgattozzi/logging
7 years ago
..
bindgen.rs feat(bindgen): use --force 7 years ago
build.rs feat(error_msg): Make custom module for errors 8 years ago
command.rs feat(log): Log information as program runs 7 years ago
emoji.rs feat(pbar): style warning/info/err better 8 years ago
error.rs feat(error_msg): Make custom module for errors 8 years ago
lib.rs feat(log): Log information as program runs 7 years ago
logger.rs feat(log): Log information as program runs 7 years ago
main.rs feat(log): Log information as program runs 7 years ago
manifest.rs Merge pull request #109 from kwonoj/feat-typescript-bindgen 8 years ago
npm.rs add default npm repo to codebase and always pass it as a param 8 years ago
progressbar.rs feat(error_msg): Make custom module for errors 8 years ago
readme.rs feat(error_msg): Make custom module for errors 8 years ago

readme.rs

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

use emoji;
use PBAR;

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(())
}