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

src/init.rs: add results check in get_borg_folder function

parent b4098640
Branches
No related tags found
No related merge requests found
...@@ -31,16 +31,16 @@ pub fn get_borg_folder() -> (PathBuf, PathBuf) { ...@@ -31,16 +31,16 @@ pub fn get_borg_folder() -> (PathBuf, PathBuf) {
let mut results = p.clone(); let mut results = p.clone();
p.push(".borg"); p.push(".borg");
results.push("results"); results.push("results");
if !results.is_dir() {
eprintln!("{} not found !", results.to_str().unwrap());
exit(1);
}
(p, results) (p, results)
} }
/// Creation of a borg repository in the same directory as the .git repository /// Creation of a borg repository in the same directory as the .git repository
pub fn init_repository() { pub fn init_repository() {
let (borg_path, results) = get_borg_folder(); let (borg_path, _) = get_borg_folder();
if !results.is_dir() {
eprintln!("{} not found !", results.to_str().unwrap());
exit(1);
}
let output = Command::new("borg") let output = Command::new("borg")
.arg("init") .arg("init")
.arg("--encryption=none") .arg("--encryption=none")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment