chrisant996 / clink-flex-prompt

Flex prompt for Clink
MIT License
135 stars 17 forks source link

Added ability to render AzureCloud information #69

Open eblis opened 1 month ago

eblis commented 1 month ago

This is my crude way of adding support for AzureCloud information. It's parsing the JSON manually, it's forcing the name of the cloud as the text and various other problems, but works enough for me for now.

The code also has an example JSON file, in case a better way to parse the JSON is implemented in the final version.

It calls az account show to get the information about the cloud instance. If not logged in it will report an error and exit with exit code 1. If logged in it will give a JSON (by default, format can be changed but I didn't bother) with various information about the environment.