Gracefully exit when --keep-stage used on clean source tree

This commit is contained in:
teapot4195 2023-01-28 15:20:27 -05:00
parent d6f0642827
commit 65186e0128

View File

@ -1431,6 +1431,13 @@ fn read_stamp_file(&self, stamp: &Path) -> Vec<(PathBuf, DependencyType)> {
return Vec::new();
}
if !stamp.exists() {
eprintln!(
"Warning: Unable to find the stamp file, did you try to keep a nonexistent build stage?"
);
crate::detail_exit(1);
}
let mut paths = Vec::new();
let contents = t!(fs::read(stamp), &stamp);
// This is the method we use for extracting paths from the stamp file passed to us. See