MCPcopy Create free account
hub / github.com/auth0/auth0-cli / detectBuildToolFromFiles

Function detectBuildToolFromFiles

internal/cli/quickstart_detect.go:471–494  ·  view source on GitHub ↗

detectBuildToolFromFiles detects the build tool by checking for config files in dir. Falls back to the conventional default for the framework if no relevant file is found.

(dir, framework string)

Source from the content-addressed store, hash-verified

469// detectBuildToolFromFiles detects the build tool by checking for config files in dir.
470// Falls back to the conventional default for the framework if no relevant file is found.
471func detectBuildToolFromFiles(dir, framework string) string {
472 if fileExistsAny(dir, "vite.config.ts", "vite.config.js") {
473 return "vite"
474 }
475 if fileExists(dir, "pom.xml") {
476 return "maven"
477 }
478 if fileExistsAny(dir, "build.gradle", "build.gradle.kts") {
479 return "gradle"
480 }
481 if fileExists(dir, "composer.json") {
482 return "composer"
483 }
484 // Framework-specific defaults as fallback.
485 switch framework {
486 case "ionic-react", "ionic-vue", "sveltekit":
487 return "vite"
488 case "spring-boot", "vanilla-java", "java-ee":
489 return "maven"
490 case "laravel", "vanilla-php":
491 return "composer"
492 }
493 return ""
494}
495
496// findJavaBuildContent finds pom.xml or build.gradle and returns content + build tool name.
497func findJavaBuildContent(dir string) (content, buildTool string, ok bool) {

Callers 1

DetectProjectFunction · 0.85

Calls 2

fileExistsAnyFunction · 0.85
fileExistsFunction · 0.85

Tested by

no test coverage detected