internal: Improve error message consistency
This commit is contained in:
parent
5d906169f4
commit
a64c02cd78
7 changed files with 72 additions and 71 deletions
|
|
@ -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
15
internal/execx/look.go
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue