New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add docker context module #996
Conversation
Adds a simple module that checks for a Docker config file and if present, reads the `currentContext` value out and displays on the prompt with a whale.
Thanks for the contribution @Southclaws. |
That's probably worth adding an option for as it's not something I'd use - I often run docker commands outside a directory with a compose file in (non-compose things like |
When enabled, will only show the docker context name if there's a docker-compose.yml file in the current directory.
Done, however I can't compile or test because Cargo/crates.io has just completely stopped working. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few suggestions but in general this LGTM.
Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>
Ah, yes, sorry I completely forgot about this PR! Will clean up today 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Southclaws, sorry for the delay in reviewing this, I've added a suggested change to the README.md
. Also as noted in the comments what do you think about enabling the module by default but only when there are the Docker files.
Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>
Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>
Thanks! Those suggestions made sense. LTGM! 👍 |
* feat: add docker context module Adds a simple module that checks for a Docker config file and if present, reads the `currentContext` value out and displays on the prompt with a whale. * feat: add `only_with_compose_yml` option to docker_context When enabled, will only show the docker context name if there's a docker-compose.yml file in the current directory. * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * rename `only_with_compose_yml` configuration key to a more generic `only_with_files` * Update src/modules/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * re-order configuration table * Update docs/config/README.md Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> * Update src/configs/docker_context.rs Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com> Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Description
Adds a simple module that checks for a Docker config file and if present, reads the
currentContext
value out and displays on the prompt with a whale.Motivation and Context
Closes #995
Types of changes
How Has This Been Tested?
Checklist: