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

src/pull.rs: update pull functions

parent 2e4edbae
No related branches found
No related tags found
No related merge requests found
...@@ -254,7 +254,12 @@ fn get_remote_archives(url: &PathBuf, adress: &str) -> Vec<String> { ...@@ -254,7 +254,12 @@ fn get_remote_archives(url: &PathBuf, adress: &str) -> Vec<String> {
/// ///
/// # Return /// # Return
/// The list of archive found remotely /// 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" { if adress == "file" {
get_local_archives(url) get_local_archives(url)
} else { } else {
...@@ -266,7 +271,7 @@ fn get_archive_list(url: &PathBuf, adress: &str) -> Vec<String> { ...@@ -266,7 +271,7 @@ fn get_archive_list(url: &PathBuf, adress: &str) -> Vec<String> {
/// ///
/// # Argument: /// # Argument:
/// - `remote`: The name of the remote /// - `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 (adress, url) = push::get_adress_and_url(remote);
let archives = get_archive_list(&url, &adress); let archives = get_archive_list(&url, &adress);
for archive in archives { for archive in archives {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment