diff --git a/prompt/async_git_prompt/README.md b/prompt/async_git_prompt/README.md index 11f707b..c423374 100644 --- a/prompt/async_git_prompt/README.md +++ b/prompt/async_git_prompt/README.md @@ -26,3 +26,8 @@ To use this module: ``` 5. To go back to synchronous mode, run `async-git-prompt-delete-cache`. + +### TODO + +- Automatic cache invalidation +- Show untracked files (this can be very expensive in large repos) diff --git a/prompt/async_git_prompt/async-git-prompt.nu b/prompt/async_git_prompt/async-git-prompt.nu index 1447c3e..c713bc8 100644 --- a/prompt/async_git_prompt/async-git-prompt.nu +++ b/prompt/async_git_prompt/async-git-prompt.nu @@ -16,7 +16,7 @@ def do-async [commands: string] { export def async-git-prompt-string [] { let cache_path = (cache-path) - if ($cache_path | empty?) { + if ($cache_path | is-empty) { "" } else if ($cache_path | path exists) { $"(cached-result-symbol)(open $cache_path | str trim)" @@ -69,7 +69,7 @@ def cache-path [] { } else { do -i { git rev-parse --show-toplevel | str trim -r } } - if ($dir | empty?) { + if ($dir | is-empty) { null } else { $dir | path join (cache-file) diff --git a/prompt/async_git_prompt/prompt.nu b/prompt/async_git_prompt/prompt.nu index a8b3eda..3b74332 100644 --- a/prompt/async_git_prompt/prompt.nu +++ b/prompt/async_git_prompt/prompt.nu @@ -3,7 +3,7 @@ use async-git-prompt.nu * def prompt-concat [parts: table] { $parts - | where (not ($it.text | empty?)) + | where (not ($it.text | is-empty)) | each { |it| $"($it.color)($it.text)" } | str collect ' ' }