Skip to content
Snippets Groups Projects
Verified Commit ae342a89 authored by nfontrod's avatar nfontrod
Browse files

src/mount.rs: get_tmp_folder uses now the function get_tmp_path in clean folder

parent 8166c524
No related branches found
No related tags found
No related merge requests found
......@@ -105,6 +105,7 @@ pub fn umount_archive(silent: bool) -> () {
}
pub mod file_diff {
use crate::clean;
use std::{
fs,
path::PathBuf,
......@@ -112,6 +113,7 @@ pub mod file_diff {
};
extern crate globwalk;
extern crate imghdr;
use colored::Colorize;
use filetime::FileTime;
/// Function used to recover files inside the folder `folder`
......@@ -210,10 +212,10 @@ pub mod file_diff {
/// Get the path of the .tmp folder at the root of the project folder. if it
/// doesn't exits, then creates it
pub(crate) fn get_tmp_folder(borgfolder: &PathBuf) -> PathBuf {
let mut tmp_folder = borgfolder.parent().unwrap().to_path_buf();
tmp_folder.push(".tmp");
let tmp_folder = clean::get_tmp_path(borgfolder);
if !tmp_folder.is_dir() {
fs::create_dir(&tmp_folder).expect("Unable to create .tmp directory");
fs::create_dir(&tmp_folder)
.expect(&format!("{}: Unable to create .tmp folder", "error".red()));
}
tmp_folder
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment