fix panic in fs_reader
This commit is contained in:
parent
d407abb50f
commit
d8ea178e69
3 changed files with 15 additions and 0 deletions
|
@ -29,6 +29,10 @@ type CommandReader struct {
|
|||
}
|
||||
|
||||
func NewCommandReader(ctx context.Context, args []string, logOutput io.Writer) (*CommandReader, error) {
|
||||
if len(args) == 0 {
|
||||
return nil, fmt.Errorf("no command was specified as argument")
|
||||
}
|
||||
|
||||
// Prepare command and stdout
|
||||
command := exec.CommandContext(ctx, args[0], args[1:]...)
|
||||
stdout, err := command.StdoutPipe()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue