Add context to file copy when pulling cheatsheets from a repo.

This commit is contained in:
Csonka Mihaly 2020-03-23 00:24:35 +01:00
parent ec0bbf4e76
commit ed8e3e43c3

View file

@ -91,7 +91,7 @@ pub fn add(uri: String) -> Result<(), Error> {
let filename = f.replace("./", "").replace("/", "__");
let to = format!("{}/{}", to_folder, filename);
fs::create_dir_all(to_folder).unwrap_or(());
fs::copy(from, to)?;
fs::copy(&from, &to).with_context(|| format!("Failed to copy `{}` to `{}`", from, to))?;
}
filesystem::remove_dir(&tmp_path_str)?;