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 50a3c0d911
commit 3c7a651d27
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, "-", "_")
}