Skip to content

Commit

Permalink
chore: lookup abs path for apfs-fuse in $PATH #570
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Jan 9, 2025
1 parent e51e031 commit 4ca5652
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/utils/macos.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/blacktop/ipsw/internal/utils/lsof"
"github.com/blacktop/ipsw/pkg/aea"
semver "github.com/hashicorp/go-version"
"golang.org/x/sys/execabs"
)

// Cp copies a file from src to dest
Expand Down Expand Up @@ -474,7 +475,11 @@ func Mount(image, mountPoint string) error {
return fmt.Errorf("%v: %s", err, out)
}
} else {
out, err := exec.Command("apfs-fuse", image, mountPoint).CombinedOutput()
apfsFusePath, err := execabs.LookPath("apfs-fuse")
if err != nil {
return fmt.Errorf("failed to find apfs-fuse in $PATH: %v", err)
}
out, err := exec.Command(apfsFusePath, image, mountPoint).CombinedOutput()
if err != nil {
return fmt.Errorf("failed to mount '%s' via apfs-fuse: %v: cmd output - '%s'", image, err, out)
}
Expand Down

0 comments on commit 4ca5652

Please sign in to comment.