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

fix(package): support alternative gradle module version syntax #6080

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

JKatzwinkel
Copy link
Contributor

Description

I changed the regex in src/modules/package.rs:113

let re = Regex::new(r#"(?m)^version ['"](?P<version>[^'"]+)['"]$"#).unwrap(); /*dark magic*/

... so it matches lines like

  version = '1.0'

... in addition to the syntax that was previously supported.

Motivation and Context

My Gradle projects use the version setting notation recommended in the documentation and I want the version to show up in my prompt.

Closes #6079

How Has This Been Tested?

Added a unit test and ran cargo test --lib.

  • 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 changed the title feat(package): support alternative gradle module version syntax (#6079) fix(package): support alternative gradle module version syntax (#6079) Jul 27, 2024
@andytom andytom changed the title fix(package): support alternative gradle module version syntax (#6079) fix(package): support alternative gradle module version syntax Jul 28, 2024
@andytom andytom merged commit a62012e into starship:master Jul 29, 2024
17 checks passed
@andytom
Copy link
Member

andytom commented Jul 29, 2024

Thank you for your contribution @JKatzwinkel and thanks for reviewing @davidkna.

@JKatzwinkel JKatzwinkel deleted the module-package-gradle branch July 29, 2024 20:26
ekorchmar pushed a commit to ekorchmar/starship that referenced this pull request Jul 30, 2024
…hip#6080)

feat(package): support alternative gradle module version syntax (starship#6079)
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.

Gradle support of package module should also support alternative notation
3 participants