Minor change in logic

This commit is contained in:
Candifloss 2024-11-30 12:22:49 +05:30
parent 735158a123
commit 3ca299e14f

View File

@ -58,8 +58,7 @@ pub fn pwd(
replace_repo: bool, replace_repo: bool,
git_repo: Option<String>, git_repo: Option<String>,
) -> ANSIGenericString<'static, str> { ) -> ANSIGenericString<'static, str> {
//let slash_limit: u8 = if replace_repo { 2 } else { 3 }; // Max number of slashes let mut slash_limit: u8 = 3; // Max number of slashes
let slash_limit: u8 = 3; // Max number of slashes
let mut path = full_path(); // Get the full path of he current directory let mut path = full_path(); // Get the full path of he current directory
// Replace a git repo root path with the repo's name // Replace a git repo root path with the repo's name
@ -68,7 +67,7 @@ pub fn pwd(
path = remove_repo(&path, &repo_path); path = remove_repo(&path, &repo_path);
let repo_name = repo_name(&repo_path); let repo_name = repo_name(&repo_path);
if shorten_path { if shorten_path {
let slash_limit: u8 = 2; // Max number of slashes slash_limit = 2; // Max number of slashes
path = short(&path, slash_limit); path = short(&path, slash_limit);
} }
return if path.is_empty() { return if path.is_empty() {