bootdeploy: remove dependency on misc.Exists

Checking for the app is unnecessary, since the cmd.Run later will fail
if it doesn't exist. This allows dropping the dependency on misc.Exists.

There's also no reason to print that the command failed, just return the
error.
This commit is contained in:
Clayton Craft
2023-02-20 22:26:02 -08:00
parent d1e150242d
commit d87a33a751

View File

@@ -8,8 +8,6 @@ import (
"os/exec"
"path/filepath"
"strings"
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/misc"
)
type BootDeploy struct {
@@ -87,14 +85,10 @@ func bootDeploy(workDir string, outDir string) error {
"-d", workDir,
"-o", outDir,
"initramfs-extra")
if !misc.Exists(cmd.Path) {
return errors.New("boot-deploy command not found")
}
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Print("'boot-deploy' command failed")
return err
}