-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add Pulumi support #335
Add Pulumi support #335
Conversation
Hi! Sorry for the delayed response, and thanks for contributing 🙂 Unfortunately this isn't in a state I'd be comfortable merging. External commands like Is there really no |
Hi, thanks for checking this out!
Will update those.
I actually did find out couple of days ago there is a command For comparison, this is the time difference in using the command and using the Python script: It consistently takes ~1+ seconds. I think the speed of the pulumi command also depends on the number of stacks for the project, as I have seen this command take upto 3+ seconds on some actual projects, even while I was on a more powerful machine. As a point, the method of reading the stack info is inspired from the Starship prompt, from this function in particular. As noted in their comment as well, pulumi does not really have a command that's fast enough for prompt usage. If there is a better fish/shell/anything based approach you (or anyone else here) can suggest for creating the SHA1 hash of the project path string, the Python dependency can be removed. Python was the fastest solution for calculating the hash I could come up with. Thanks! |
Indeed there is: I'm on a mac right now, so the replacement for your python would be If you could remove the python code and instead check for |
Aww snap don't tell anyone but just adding the |
I actually forgot to mention in my previous message that I had tried Thanks! |
Hi, I've updated it with your suggestions. Lemme know your thoughts. Thanks! |
I made some improvements/changes to the code, feel free to take a look at them and comment/ask questions :) |
Hey, the improvements look good to me! So many fish builtins I did not know about till this PR 😄 Thanks! |
Description
Add a right prompt section for displaying current Pulumi stack of the project. It reads the stack name from a local json file named using hash of the project path. This section will only show up if the directory has a
Pulumi.yaml
file (similar to apackage.json
file for node), which is something that's always created by pulumi for a new project.Motivation and Context
Pulumi is an IaaC tool that I use quite often from the command line and knowing the current stack that I am on before running commands is quite helpful.
Screenshots (if appropriate)
Yellow prompt section in below screenshots.
dev
is the name of the current stack.Lean
Classic
Rainbow
How Has This Been Tested
Checklist