Skip to content

Commit b8a2ed9

Browse files
authored
Merge pull request #141 from stm32-rs/fix-makedeps
Fix makedeps to write path to .d file
2 parents 9a5e301 + 35c98b2 commit b8a2ed9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/makedeps/makedeps_cli.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ fn write_file(file_name: &Path, deps: Vec<PathBuf>) -> Result<()> {
1717
// Open a file in write-only mode
1818
let mut file = File::create(file_name)?;
1919

20-
let file_name = format!("{}:", file_name.file_name().unwrap().to_str().unwrap());
20+
let file_name = format!("{}:", file_name.to_str().unwrap());
2121
write_to_file(&mut file, &file_name)?;
2222

2323
for dep in deps {
2424
let dep_string = format!(" {}", dep.into_os_string().into_string().unwrap());
2525
write_to_file(&mut file, &dep_string)?;
2626
}
2727

28+
write_to_file(&mut file, "\n")?;
29+
2830
Ok(())
2931
}
3032

@@ -69,7 +71,8 @@ mod tests {
6971

7072
let deps: String = fs::read_to_string(deps_file)?.parse()?;
7173
let exp_string = format!(
72-
"test.d: {} {}",
74+
"{}/test.d: {} {}\n",
75+
out_dir.path().display(),
7376
test_dir.join(Path::new("sub-tests/inc1.yaml")).display(),
7477
test_dir.join(Path::new("sub-tests/inc2.yaml")).display()
7578
);

0 commit comments

Comments
 (0)