plugin: don't consider file extension for env prefix

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-05-18 13:10:16 +02:00
parent bfe59cd8f8
commit 13513b563b
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -118,7 +118,9 @@ func (c *Config) getEnvVarPrefix() string {
return c.EnvPrefix
}
prefix := strings.ToUpper(filepath.Base(c.Cmd)) + "_"
baseName := filepath.Base(c.Cmd)
name := strings.TrimSuffix(baseName, filepath.Ext(baseName))
prefix := strings.ToUpper(name) + "_"
return strings.ReplaceAll(prefix, "-", "_")
}