Skip to content

Commit

Permalink
handle unset stdout / stderr (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
elenz97 authored Mar 7, 2024
1 parent b29c4bb commit de8c9fc
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pkg/proc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,26 @@ func newBaseJob(jobConfig *config.BaseJobConfig) (*baseJob, error) {
}

func (job *baseJob) CreateAndOpenStdFile(jobConfig *config.BaseJobConfig) error {
stdout, err := prepareStdFile(jobConfig.Stdout)
if err != nil {
return err
}
job.stdout = stdout

if len(jobConfig.Stderr) == 0 {
return nil
if jobConfig.Stdout != "" {
stdout, err := prepareStdFile(jobConfig.Stdout)
if err != nil {
return err
}
job.stdout = stdout
}

if jobConfig.Stderr == jobConfig.Stdout {
job.stderr = job.stdout
return nil
}
if jobConfig.Stderr != "" {
if jobConfig.Stderr == jobConfig.Stdout {
job.stderr = job.stdout
return nil
}

stderr, err := prepareStdFile(jobConfig.Stderr)
if err != nil {
return err
stderr, err := prepareStdFile(jobConfig.Stderr)
if err != nil {
return err
}
job.stderr = stderr
}
job.stderr = stderr

return nil
}
Expand Down

0 comments on commit de8c9fc

Please sign in to comment.