MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / HasShebang

Method HasShebang

src/java/containers/groovy_utils.go:63–69  ·  view source on GitHub ↗

HasShebang checks if a Groovy file has a shebang line (#!/...)

(filePath string)

Source from the content-addressed store, hash-verified

61
62// HasShebang checks if a Groovy file has a shebang line (#!/...)
63func (g *GroovyUtils) HasShebang(filePath string) bool {
64 content, err := os.ReadFile(filePath)
65 if err != nil {
66 return false
67 }
68 return shebangPattern.Match(content)
69}
70
71// IsBeans checks if a Groovy file is a beans-style configuration
72func (g *GroovyUtils) IsBeans(filePath string) bool {

Callers 3

FindMainGroovyScriptFunction · 0.95
noShebangMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected