diff --git a/src/lib.rs b/src/lib.rs index 7da84a4..8de99a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,7 +35,7 @@ use crate::lock::{ }; use crate::utils::{ get_current_working_dir, - check_for_sensitive_files_or_directories_recursive, + check_dotfiles_recursive, prompt_user_for_confirmation }; use crate::versioning::push_version; @@ -279,7 +279,7 @@ pub async fn run(command: Subcommands) -> Result<(), SoldeerError> { let path_buf = PathBuf::from(&path); // Check for sensitive files or directories - if check_for_sensitive_files_or_directories_recursive(&path_buf) { + if check_dotfiles_recursive(&path_buf) { if !prompt_user_for_confirmation() { println!("{}", Paint::yellow("Push operation aborted by the user.")); return Ok(()); diff --git a/src/utils.rs b/src/utils.rs index 2ba67a3..718399c 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -119,7 +119,7 @@ pub fn get_base_url() -> String { } // Function to check for the presence of sensitive files or directories -pub fn check_for_sensitive_files_or_directories(path: &Path) -> bool { +pub fn check_dotfiles(path: &Path) -> bool { if let Ok(entries) = fs::read_dir(path) { for entry in entries { if let Ok(entry) = entry { @@ -135,8 +135,8 @@ pub fn check_for_sensitive_files_or_directories(path: &Path) -> bool { } // Function to recursively check for sensitive files or directories in a given path -pub fn check_for_sensitive_files_or_directories_recursive(path: &Path) -> bool { - if check_for_sensitive_files_or_directories(path) { +pub fn check_dotfiles_recursive(path: &Path) -> bool { + if check_dotfiles(path) { return true; } @@ -144,7 +144,7 @@ pub fn check_for_sensitive_files_or_directories_recursive(path: &Path) -> bool { for entry in fs::read_dir(path).unwrap() { let entry = entry.unwrap(); let entry_path = entry.path(); - if check_for_sensitive_files_or_directories_recursive(&entry_path) { + if check_dotfiles_recursive(&entry_path) { return true; } }