mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
fix(java): Add detection for *.gradle files (#871)
Currently the Java module detection looks for build.gradle specifically, but it's possible to rename build.gradle to *.gradle. This change adds Gradle files to the list of detected file extensions.
This commit is contained in:
+4
-4
@@ -8,13 +8,13 @@ use crate::utils;
|
||||
/// Creates a module with the current Java version
|
||||
///
|
||||
/// Will display the Java version if any of the following criteria are met:
|
||||
/// - Current directory contains a file with a `.java`, `.class` or `.jar` extension
|
||||
/// - Current directory contains a `pom.xml`, `build.gradle`, `build.gradle.kts` or `build.sbt` file
|
||||
/// - Current directory contains a file with a `.java`, `.class`, `.gradle` or `.jar` extension
|
||||
/// - Current directory contains a `pom.xml`, `build.gradle.kts` or `build.sbt` file
|
||||
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
let is_java_project = context
|
||||
.try_begin_scan()?
|
||||
.set_files(&["pom.xml", "build.gradle", "build.gradle.kts", "build.sbt"])
|
||||
.set_extensions(&["java", "class", "jar"])
|
||||
.set_files(&["pom.xml", "build.gradle.kts", "build.sbt"])
|
||||
.set_extensions(&["java", "class", "jar", "gradle"])
|
||||
.is_match();
|
||||
|
||||
if !is_java_project {
|
||||
|
||||
Reference in New Issue
Block a user