func RunCommand(ctx context.Context, cmd string, args ...string) (string, error) {

	var c *exec.Cmd

	if ctx != nil {
		c = exec.CommandContext(ctx, cmd, args...)
	} else {
		c = exec.Command(cmd, args...)
	}

	output, err := c.Output()
	if err != nil {
		return string(output), err
	}

	// check for exec context timeout
	if ctx != nil {
		if ctx.Err() == context.DeadlineExceeded {
			return "", fmt.Errorf("command %s timed out", cmd)
		}
	}

	return string(output), nil
}
func RunCommand(ctx context.Context, cmd string, args ...string) (string, error) {

	var c *exec.Cmd

	if ctx != nil {
		c = exec.CommandContext(ctx, cmd, args...)
	} else {
		c = exec.Command(cmd, args...)
	}

	output, err := c.Output()
	if err != nil {
		return string(output), err
	}

	// check for exec context timeout
	if ctx != nil {
		if ctx.Err() == context.DeadlineExceeded {
			return "", fmt.Errorf("command %s timed out", cmd)
		}
	}

	return string(output), nil
}
func RunCommand ( ctx context . Context , cmd string , args ... string ) ( string , error ) { var c * exec . Cmd if ctx != nil { c = exec . CommandContext ( ctx , cmd , args ... ) } else { c = exec . Command ( cmd , args ... ) } output , err := c . Output ( ) if err != nil { return string ( output ) , err } // check for exec context timeout if ctx != nil { if ctx . Err ( ) == context . DeadlineExceeded { return " " , fmt . Errorf ( " " , cmd ) } } return string ( output ) , nil }
// RunCommand runs cmd on file
RunCommand runs cmd on file