Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Nov 25, 2024
1 parent 175dcc9 commit 2072719
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/modgearman/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ func parseCommand(rawCommand string, config *config) *command {
parsed.Command = args[0]
parsed.Args = args[1:]
parsed.ExecType = Exec
for _, env := range envs {
splitted := strings.SplitN(env, "=", 2)
parsed.Env[splitted[0]] = splitted[1]
}
parsed.appendEnv(envs)

if fileUsesEmbeddedPerl(parsed.Command, config) {
parsed.ExecType = EPN
Expand All @@ -80,3 +77,10 @@ func parseCommand(rawCommand string, config *config) *command {

return parsed
}

func (com *command) appendEnv(envs []string) {
for _, env := range envs {
splitted := strings.SplitN(env, "=", 2)
com.Env[splitted[0]] = splitted[1]
}
}

0 comments on commit 2072719

Please sign in to comment.