Skip to content

Commit

Permalink
Merge pull request #21 from cs278/handle-files-not-existing
Browse files Browse the repository at this point in the history
Handle polyfill files not existing
  • Loading branch information
cs278 authored Nov 5, 2021
2 parents 05d5dc5 + 7935cb9 commit 7ef9fef
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/PolyfillLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ public static function load(Composer $composer, IOInterface $io)
$installPath = $composer->getInstallationManager()->getInstallPath($package);

foreach ($autoload['files'] as $file) {
$io->debug(sprintf('PolyfillLoader found: %s %s', $package->getName(), $file));
$includeFiles[] = $installPath.\DIRECTORY_SEPARATOR.$file;
$path = $installPath.\DIRECTORY_SEPARATOR.$file;

if (\file_exists($path)) {
$io->debug(sprintf('PolyfillLoader found: %s %s', $package->getName(), $file));
$includeFiles[] = $path;
} else {
$io->warning(sprintf('PolyfillLoader file not found: %s %s', $package->getName(), $path));
}
}
}
}
Expand Down

0 comments on commit 7ef9fef

Please sign in to comment.