Skip to content

Commit

Permalink
Only include in watchable paths existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzap committed Mar 6, 2024
1 parent 8f2f82e commit 9fac1fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/Asset/HashBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ public function forAsset(Asset $asset): ?string

$files = $this->pathsFinder->findAssetPaths($asset);

if ($files === []) {
$this->hashes[$key] = null;

return null;
}

if ($this->io->isVerbose()) {
foreach ($files as $file) {
$this->io->write("Will use '{$file}' file to calculate package hash");
Expand Down
4 changes: 3 additions & 1 deletion src/Asset/PathsFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public function findAssetPaths(Asset $asset): array
/** @var list<non-empty-string> $files */
$files = [];
foreach (self::DEFAULT_FILES as $defaultFilePath) {
$files[] = $this->relativePath($basePath . $defaultFilePath);
if (file_exists($basePath . $defaultFilePath)) {
$files[] = $this->relativePath($basePath . $defaultFilePath);
}
}

$finder = $this->createFinder($asset);
Expand Down
1 change: 0 additions & 1 deletion src/Composer/Command/AssetsInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Inpsyde\AssetsCompiler\Util\Factory;
use Inpsyde\AssetsCompiler\Util\Io;
use phpDocumentor\Reflection\Types\Scalar;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down
2 changes: 1 addition & 1 deletion src/Util/ModeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function mode(): string

/**
* @param array $config
* @return mixed|null
* @return mixed
*/
public function resolveConfig(array $config): mixed
{
Expand Down

0 comments on commit 9fac1fb

Please sign in to comment.