fix panic in fs_reader

This commit is contained in:
textaligncenter 2024-08-03 16:44:45 +00:00
parent d407abb50f
commit d8ea178e69
3 changed files with 15 additions and 0 deletions

View file

@ -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()