Skip to content
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(env_var): Add support for env_var.VAR in format #4497

Merged
merged 2 commits into from Dec 28, 2022

Conversation

davidkna
Copy link
Member

Description

This PR allows using ${env_var.VAR} in format strings. Unlike #3375, I handled this in a shared manner with custom modules by moving the code paths for custom and env_var modules closer to other regular modules, leveraging modules::handle (which tests for custom modules were using). This allows removing the timing-handling from the custom module code.

Motivation and Context

Closes #3259
Closes #3375

Screenshots (if appropriate):

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

@davidkna davidkna force-pushed the env-dot branch 2 times, most recently from 490068d to 31c7de5 Compare October 18, 2022 13:38
Co-Authored-By: Segev Finer <24731903+segevfiner@users.noreply.github.com>
Copy link
Member

@andytom andytom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but looks like we have some merge conflicts.

@andytom andytom merged commit 5d4cb6f into starship:master Dec 28, 2022
@davidkna davidkna deleted the env-dot branch December 28, 2022 20:29
@jaimehrubiks
Copy link

for some reason I cannot make this work

right_format = """>${env_var.ZVM_MODE_CUSTOM}<"""
[env_var.ZVM_MODE_CUSTOM]
variable = 'ZVM_MODE_CUSTOM'
default = ''

@davidkna
Copy link
Member Author

davidkna commented Feb 17, 2023

@jaimehrubiks These changes aren't included in the latest version of starship yet. They will be included with starship v1.13.

@jaimehrubiks
Copy link

Ups, now I see! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customize env_var display order in format like what can be done for custom
3 participants