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

src/push.rs: function order change

parent e1744280
Branches
No related tags found
No related merge requests found
...@@ -54,19 +54,6 @@ fn check_glob_exist_local(remote_file: &PathBuf) -> Option<PathBuf> { ...@@ -54,19 +54,6 @@ fn check_glob_exist_local(remote_file: &PathBuf) -> Option<PathBuf> {
} }
} }
/// Function that checks if a glob file exists and return the first path found
/// if it's the case
///
/// # Arguments
/// - `remote_file`: The remote glob located by the remote
/// - `adress`: The adress of the remote folder
fn check_glob_file_exists(remote_file: &PathBuf, adress: &str) -> Option<PathBuf> {
if adress == "file" {
check_glob_exist_local(remote_file)
} else {
check_glob_file_exist_remote(remote_file, adress)
}
}
/// Function that check if a dir exist on a remote filesystem /// Function that check if a dir exist on a remote filesystem
/// # Arguments /// # Arguments
...@@ -94,6 +81,22 @@ fn check_glob_file_exist_remote(remote_tar: &PathBuf, adress: &str) -> Option<Pa ...@@ -94,6 +81,22 @@ fn check_glob_file_exist_remote(remote_tar: &PathBuf, adress: &str) -> Option<Pa
} }
} }
/// Function that checks if a glob file exists and return the first path found
/// if it's the case
///
/// # Arguments
/// - `remote_file`: The remote glob located by the remote
/// - `adress`: The adress of the remote folder
fn check_glob_file_exists(remote_file: &PathBuf, adress: &str) -> Option<PathBuf> {
if adress == "file" {
check_glob_exist_local(remote_file)
} else {
check_glob_file_exist_remote(remote_file, adress)
}
}
/// Function that check if a dir exist on a remote filesystem /// Function that check if a dir exist on a remote filesystem
/// # Arguments /// # Arguments
/// - `remote_dir`: The remote dir located by the remote /// - `remote_dir`: The remote dir located by the remote
...@@ -145,7 +148,7 @@ pub(crate) fn handle_existing_remote_file( ...@@ -145,7 +148,7 @@ pub(crate) fn handle_existing_remote_file(
adress: &str, adress: &str,
cmd: &str, cmd: &str,
) -> PathBuf { ) -> PathBuf {
let archive = remote_file.file_stem().unwrap().to_str().unwrap(); let archive = remote_file.file_stem().unwrap().to_str().unwrap().split('.').collect::<Vec<_>>()[0];
let filename_glob = remote_file let filename_glob = remote_file
.parent() .parent()
.unwrap() .unwrap()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment