1 // Interface to run commands
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 // Copyright (C) 2021-2024 Simon Ruderich
12 // Runner abstracts running commands to permit testing.
13 type Runner interface {
15 CombinedOutput(*exec.Cmd) ([]byte, error)
18 // ExecRunner implements Runner by calling the corresponding function from
20 type ExecRunner struct {
23 func (r ExecRunner) Run(cmd *exec.Cmd) error {
26 func (r ExecRunner) CombinedOutput(cmd *exec.Cmd) ([]byte, error) {
27 return cmd.CombinedOutput()