diff --git a/src/PrivateKey.php b/src/PrivateKey.php index d00ba6b..2665808 100644 --- a/src/PrivateKey.php +++ b/src/PrivateKey.php @@ -45,7 +45,18 @@ public function encode(): string public function getPublicKey(): PublicKey { - $result = Process::input($this->encode())->run('age-keygen -y'); + /** + * @var array|string|null + */ + $command = [ + (new ExecutableFinder())->find('age-keygen', 'age-keygen', [ + '/usr/local/bin', + '/opt/homebrew/bin', + ]), + '-y', + ]; + + $result = Process::input($this->encode())->run($command); if ($result->failed()) { throw new Exception('Failed to generate public key!');