Init project

This commit is contained in:
2026-05-21 05:43:10 +02:00
parent d408d01002
commit da819c22f6
2 changed files with 21 additions and 17 deletions
+3 -17
View File
@@ -10,9 +10,9 @@ use mist_parser::error::ParseError;
pub fn build() -> PathBuf {
let start = Instant::now();
let root = find_project_root().unwrap_or_else(|| {
panic!("error: could not find project root (mist.json)");
});
let root = std::env::current_dir()
.ok()
.expect("Unable to find project root");
let src_dir = root.join("src");
let out_dir = root.join(".mist/src");
@@ -164,17 +164,3 @@ fn should_skip(source: &Path, output: &Path) -> bool {
}
false
}
pub fn find_project_root() -> Option<PathBuf> {
let mut dir = std::env::current_dir().ok()?;
loop {
if dir.join("mist.json").exists() {
return Some(dir);
}
if !dir.pop() {
return None;
}
}
}