Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,9 @@ impl Config {
.iter()
.map(|(p, cf)| {
let mut watch_files: Vec<WatchFilePattern> = vec![p.as_path().into()];
if let Some(parent) = p.parent() {
watch_files.push(parent.join("mise.lock").into());
}
watch_files.extend(cf.watch_files()?.iter().map(|wf| WatchFilePattern {
root: cf.project_root().map(|pr| pr.to_path_buf()),
patterns: wf.patterns.clone(),
Expand Down
9 changes: 9 additions & 0 deletions src/hook_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ impl From<&Path> for WatchFilePattern {
}
}

impl From<PathBuf> for WatchFilePattern {
fn from(path: PathBuf) -> Self {
Self {
patterns: vec![path.to_string_lossy().to_string()],
root: Some(path),
}
}
}

/// this function will early-exit the application if hook-env is being
/// called and it does not need to be
pub fn should_exit_early(watch_files: impl IntoIterator<Item = WatchFilePattern>) -> bool {
Expand Down
Loading