Moved docs/src/main.rs to docs/src/lib.rs and imported it into the repl. Commented out doc code to avoid it deleting my entire roc project (which happened)

This commit is contained in:
Chadtech 2021-03-21 22:37:39 -04:00
parent 22f77ed966
commit 807250f3e3
7 changed files with 324 additions and 321 deletions

View file

@ -1,6 +1,6 @@
use roc_cli::{build, build_app, repl, DIRECTORY_OR_FILES};
use roc_cli::{build, docs, build_app, repl, DIRECTORY_OR_FILES};
use std::io;
use std::path::Path;
use std::path::{Path, PathBuf};
use target_lexicon::Triple;
fn main() -> io::Result<()> {
@ -35,6 +35,21 @@ fn main() -> io::Result<()> {
}
}
}
Some("docs") => {
let values = matches
.subcommand_matches("docs")
.unwrap()
.values_of_os(DIRECTORY_OR_FILES)
.unwrap();
let paths = values
.map(|os_str| Path::new(os_str).to_path_buf())
.collect::<Vec<PathBuf>>();
docs(paths);
Ok(())
}
_ => unreachable!(),
}
}