mirror of
https://github.com/IlanCosman/tide.git
synced 2024-08-17 04:00:22 +03:00
Support multiple 'default' contexts for Docker (#283)
* Support multiple 'default' contexts for Docker If someone is using 'colima' instead of Docker Desktop, the default context is 'colima'. Rather than making two tests with fixed values, add a new configuration variable and use `contains`. * Remove non-colour configuration from color files
This commit is contained in:
parent
11ac7bacfe
commit
26f1a8d572
@ -1,4 +1,5 @@
|
||||
function _tide_item_docker
|
||||
docker context inspect --format '{{.Name}}' | read -l context
|
||||
test "$context" != default && _tide_print_item docker $tide_docker_icon' ' $context
|
||||
contains -- "$context" $tide_docker_default_contexts ||
|
||||
_tide_print_item docker $tide_docker_icon' ' $context
|
||||
end
|
||||
|
@ -20,6 +20,7 @@ tide_context_color_ssh D7AF87
|
||||
tide_docker_bg_color 444444
|
||||
tide_docker_color 2496ED
|
||||
tide_docker_icon
|
||||
tide_docker_default_contexts default colima
|
||||
tide_git_bg_color 444444
|
||||
tide_git_bg_color_unstable 444444
|
||||
tide_git_bg_color_urgent 444444
|
||||
|
@ -19,6 +19,7 @@ tide_context_color_root $_tide_color_gold
|
||||
tide_context_color_ssh D7AF87
|
||||
tide_docker_bg_color normal
|
||||
tide_docker_color 2496ED
|
||||
tide_docker_default_contexts default colima
|
||||
tide_docker_icon
|
||||
tide_git_bg_color normal
|
||||
tide_git_bg_color_unstable normal
|
||||
|
@ -19,6 +19,7 @@ tide_context_color_root $_tide_color_gold
|
||||
tide_context_color_ssh D7AF87
|
||||
tide_docker_bg_color 2496ED
|
||||
tide_docker_color 000000
|
||||
tide_docker_default_contexts default colima
|
||||
tide_docker_icon
|
||||
tide_git_bg_color 4E9A06
|
||||
tide_git_bg_color_unstable C4A000
|
||||
|
@ -9,5 +9,12 @@ set -lx tide_docker_icon
|
||||
mock docker "context inspect" "printf default"
|
||||
_docker # CHECK:
|
||||
|
||||
mock docker "context inspect" "printf colima"
|
||||
_docker # CHECK:
|
||||
|
||||
mock docker "context inspect" "printf curr-context"
|
||||
_docker # CHECK: curr-context
|
||||
|
||||
mock docker "context inspect" "printf curr-context"
|
||||
set -lx tide_docker_default_contexts curr-context
|
||||
_docker # CHECK:
|
||||
|
Loading…
Reference in New Issue
Block a user