diff --git a/src/pull.rs b/src/pull.rs index ccdd0baaceebc47d6991ca429961617ca334d1fd..b8ac4b7cc71b456c05fdb6d7d75583672f920df4 100644 --- a/src/pull.rs +++ b/src/pull.rs @@ -254,7 +254,12 @@ fn get_remote_archives(url: &PathBuf, adress: &str) -> Vec<String> { /// /// # Return /// The list of archive found remotely -fn get_archive_list(url: &PathBuf, adress: &str) -> Vec<String> { +pub(crate) fn get_archive_list(url: &PathBuf, adress: &str) -> Vec<String> { + let exist = push::check_dir_exist(url, adress); + if !exist { + eprintln!("{}: {} folder doesn't exists !", "error".red(), url.to_str().unwrap().yellow()); + exit(1); + } if adress == "file" { get_local_archives(url) } else { @@ -266,7 +271,7 @@ fn get_archive_list(url: &PathBuf, adress: &str) -> Vec<String> { /// /// # Argument: /// - `remote`: The name of the remote -fn pull_all_archives(remote: &str) { +pub(crate) fn pull_all_archives(remote: &str) { let (adress, url) = push::get_adress_and_url(remote); let archives = get_archive_list(&url, &adress); for archive in archives {