Skip to content

Commit

Permalink
also check for rescript config
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrolich committed Mar 8, 2024
1 parent 9096227 commit 6ff6db1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ pub fn compute_file_hash(path: &str) -> Option<blake3::Hash> {
}
}

fn has_bs_config(path: &PathBuf) -> bool {
path.join("bsconfig.json").exists()
fn has_rescript_config(path: &PathBuf) -> bool {
path.join("bsconfig.json").exists() || path.join("rescript.json").exists()
}

pub fn get_workspace_root(package_root: &str) -> Option<String> {
Expand All @@ -301,7 +301,7 @@ pub fn get_workspace_root(package_root: &str) -> Option<String> {
pub fn get_nearest_bsconfig(path_buf: &PathBuf) -> Option<String> {
let mut current_dir = path_buf.to_owned();
loop {
if has_bs_config(&current_dir) {
if has_rescript_config(&current_dir) {
return Some(current_dir.to_string_lossy().to_string());
}
match current_dir.parent() {
Expand Down

0 comments on commit 6ff6db1

Please sign in to comment.