config: fix loading commands args from env vars

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-06-25 21:31:57 +02:00
parent 4440c49174
commit d1e4ee7bc8
2 changed files with 11 additions and 1 deletions

View File

@@ -1961,6 +1961,11 @@ func getCommandConfigsFromEnv(idx int) {
cfg.Env = env
}
args, ok := lookupStringListFromEnv(fmt.Sprintf("SFTPGO_COMMAND__COMMANDS__%v__ARGS", idx))
if ok {
cfg.Args = args
}
if cfg.Path != "" {
if len(globalConf.CommandConfig.Commands) > idx {
globalConf.CommandConfig.Commands[idx] = cfg