git print better
This commit is contained in:
@@ -32,7 +32,7 @@ fn format_repo_info(repo GitRepo) ![]string {
|
||||
'[${repo.status_local.branch}]' // Otherwise, display branch
|
||||
}
|
||||
|
||||
relative_path := repo.get_relative_path()!
|
||||
relative_path := repo.get_human_path()!
|
||||
return [' - ${relative_path}', tag_or_branch, status]
|
||||
}
|
||||
|
||||
|
||||
@@ -71,6 +71,13 @@ pub fn (repo GitRepo) get_relative_path() !string {
|
||||
return mypath.path_relative(repo_.gs.coderoot.path) or { panic("couldn't get relative path") }
|
||||
}
|
||||
|
||||
//path where we use ~ and its the full path
|
||||
pub fn (repo GitRepo) get_human_path() !string {
|
||||
mut mypath := repo.patho()!.path.replace(os.home_dir(),"~")
|
||||
return mypath
|
||||
}
|
||||
|
||||
|
||||
pub fn (mut repo GitRepo) get_parent_dir(args GetParentDir) !string {
|
||||
repo_path := repo.path()
|
||||
parent_dir := os.dir(repo_path)
|
||||
|
||||
Reference in New Issue
Block a user