From 26dfeb8d5f15b0376471bcdb6c1a3c00138d000d Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 2 Feb 2023 21:32:10 +0000 Subject: [PATCH] Throw an exception if 'patch' command not found --- src/Plugin/Patches.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Plugin/Patches.php b/src/Plugin/Patches.php index 71f52403..22c28a4b 100644 --- a/src/Plugin/Patches.php +++ b/src/Plugin/Patches.php @@ -447,6 +447,10 @@ protected function getAndApplyPatch(HttpDownloader $downloader, $install_path, $ // In some rare cases, git will fail to apply a patch, fallback to using // the 'patch' command. if (!$patched) { + if (! $this->executeCommand('command -v patch')) { + throw new Exception('Cannot find "patch" command; unable to apply patches'); + } + // This is a workaround for the outdated patch version on BSD // systems which doesn't support this option -> use posix then. // --no-backup-if-mismatch here is a hack that fixes some