From 24da182230ab7460fbb4a201981b59e1cf22475d Mon Sep 17 00:00:00 2001 From: Florent Torregrosa Date: Wed, 27 Dec 2023 11:05:59 +0100 Subject: [PATCH] Issue #39: Fix unhandled promise rejection. Test on PHP 8.2 and 8.3. --- .github/workflows/tests.yml | 2 ++ src/FileFetcher.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d55cfc1..28f4b4c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,6 +20,8 @@ jobs: matrix: php-versions: - '8.1' + - '8.2' + - '8.3' drupal-release: - 'stable' composer-channel: diff --git a/src/FileFetcher.php b/src/FileFetcher.php index 8a72b2e..49b16d4 100644 --- a/src/FileFetcher.php +++ b/src/FileFetcher.php @@ -104,6 +104,8 @@ public function fetch(array $drupal_projects, $destination) { $this->io->write(" - $filename ($url): ", FALSE); } + // Test that the file exists before trying to copy it. + $this->httpDownloader->get($url); $this->httpDownloader->copy($url, $destination . '/' . $filename); if ($this->progress) {