mirror of
https://github.com/starship/starship.git
synced 2024-11-22 16:23:17 +01:00
Add some clarifying documentation
This commit is contained in:
parent
fdacd1cf28
commit
3c07e284fe
@ -26,10 +26,6 @@ pub fn segment(_: &ArgMatches) -> Segment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if let Love(tiff) = matan::Love(tiff) {
|
|
||||||
// log tiff + matan + kimu + nimu + puku + owl fren + roomba fren + cactus fren + rumple
|
|
||||||
// }
|
|
||||||
|
|
||||||
Segment {
|
Segment {
|
||||||
value: String::from(dir_string),
|
value: String::from(dir_string),
|
||||||
style: Style::from(COLOR_DIR).bold(),
|
style: Style::from(COLOR_DIR).bold(),
|
||||||
@ -37,6 +33,7 @@ pub fn segment(_: &ArgMatches) -> Segment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the root directory of a git repo
|
||||||
fn get_repo_root(repo: Repository) -> PathBuf {
|
fn get_repo_root(repo: Repository) -> PathBuf {
|
||||||
match repo.is_bare() {
|
match repo.is_bare() {
|
||||||
// A bare repo will return its root path
|
// A bare repo will return its root path
|
||||||
@ -46,6 +43,7 @@ fn get_repo_root(repo: Repository) -> PathBuf {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Replace the home directory in the path with "~"
|
||||||
fn truncate_home(path: &PathBuf) -> Option<String> {
|
fn truncate_home(path: &PathBuf) -> Option<String> {
|
||||||
const HOME_SYMBOL: &str = "~";
|
const HOME_SYMBOL: &str = "~";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user