internal: Improve error message consistency

This commit is contained in:
Tom Wiesing 2022-09-04 14:01:01 +02:00
parent 5d906169f4
commit a64c02cd78
No known key found for this signature in database
7 changed files with 72 additions and 71 deletions

View file

@ -1,11 +0,0 @@
package execx
import (
"github.com/tkw1536/goprogram/stream"
)
// Compose runs a docker-compose command in a specific directory, with the provided arguments and streams.
// It then waits for the process to exit, and returns the exit code.
func Compose(io stream.IOStream, workdir string, args ...string) int {
return Exec(io, workdir, "docker", append([]string{"compose"}, args...)...)
}

15
internal/execx/look.go Normal file
View file

@ -0,0 +1,15 @@
package execx
import (
"os/exec"
"path/filepath"
)
// LookPathAbs is like [exec.LookPath], but always returns an absolute path
func LookPathAbs(file string) (string, error) {
path, err := exec.LookPath(file)
if err != nil {
return "", err
}
return filepath.Abs(path)
}