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

Getting a package version from gradle.properties is not implemented correctly #4759

Closed
swpalmer opened this issue Dec 26, 2022 · 0 comments · Fixed by #4760
Closed

Getting a package version from gradle.properties is not implemented correctly #4759

swpalmer opened this issue Dec 26, 2022 · 0 comments · Fixed by #4760
Labels
🐛 bug Something isn't working as expected.

Comments

@swpalmer
Copy link
Contributor

Current Behavior

Commented out lines in gradle.properties with 'version=' will be matched as defining a version. versions defined with whitespace between 'version' and '=' will not be extract properly.

Expected Behavior

Comment lines should be ignored. Whitespace should be allowed on either side of '='.

Additional context/Screenshots

E.g. this content in a gradle.properties file should NOT set the version to 0.0.1

# Generally it is better to set the version only for release builds, build time
# from command line using -Pversion=0.0.1

Possible Solution

Fix the regex on this line https://github.com/starship/starship/blob/master/src/modules/package.rs#L108

Environment

  • Starship version: 1.12.0
  • zsh version: zsh 5.8.1 (x86_64-apple-darwin22.0)
  • Operating system: Mac OS 13.2.0
  • Terminal emulator: WarpTerminal v0.2022.12.13.08.04.stable_01
  • Git Commit Hash:
  • Branch/Tag: master
  • Rust Version: rustc 1.65.0 (897e37553 2022-11-02)
  • Rust channel: stable-x86_64-apple-darwin release
  • Build Time: 2022-12-13 16:12:55 +00:00
@swpalmer swpalmer added the 🐛 bug Something isn't working as expected. label Dec 26, 2022
swpalmer added a commit to swpalmer/starship that referenced this issue Dec 26, 2022
andytom pushed a commit that referenced this issue Dec 27, 2022
….properties (#4760)

fix: Improve regex for extracting gradle package version from gradle.properties (#4759)
Indyandie pushed a commit to Indyandie/starship that referenced this issue Jul 26, 2023
….properties (starship#4760)

fix: Improve regex for extracting gradle package version from gradle.properties (starship#4759)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant