Define the LANG variable when executing actions
This commit is contained in:
parent
ea1724e2ca
commit
37c951ef85
4 changed files with 24 additions and 6 deletions
|
|
@ -174,8 +174,9 @@ func (a *Action) Remove() error {
|
|||
return os.Remove(a.Path)
|
||||
}
|
||||
|
||||
func (a *Action) Launch() (cmd *exec.Cmd, err error) {
|
||||
func (a *Action) Launch(settings *Settings) (cmd *exec.Cmd, err error) {
|
||||
cmd = exec.Command(a.fullPath)
|
||||
cmd.Env = append(cmd.Environ(), fmt.Sprintf("LANG=%s", settings.Language))
|
||||
err = cmd.Start()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,9 +148,15 @@ func (a *Routine) Launch(cfg *config.Config) error {
|
|||
continue
|
||||
}
|
||||
|
||||
settings, err := ReadSettings(cfg.SettingsFile)
|
||||
if err != nil {
|
||||
log.Printf("Unable to read settings: %s", err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
time.Sleep(time.Duration(s.Delay) * time.Second)
|
||||
|
||||
cmd, err := act.Launch()
|
||||
cmd, err := act.Launch(settings)
|
||||
if err != nil {
|
||||
log.Printf("Unable to launch the action %q: %s", s.Action, err.Error())
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue