Open sakhunzai opened 9 years ago
Use you the last stable versions (v1.0.2) of this plugin and composer?
yes both are latest :
composer self-update
composer global require "fxp/composer-asset-plugin:~1.0.2"
Indeed, it seems that the change of directory is not supported by the IgnoreFactory.
some other observation that might help fix the bug
a) A quick fix copying logic from AssetInstaller
constructor to Installer\IngnoreFActory::getInstallDir
protected static function getInstallDir(Composer $composer, PackageInterface $package, $installDir = null)
{
if (null === $installDir) {
$extra = $composer->getPackage()->getExtra();
if (!empty($extra['asset-installer-paths'][$this->type])) {
$vendorDir = rtrim($extra['asset-installer-paths'][$this->type], '/');
} else {
$vendorDir = rtrim($this->vendorDir.'/'.$assetType->getComposerVendorName(), '/');
}
$installDir = $vendorDir.'/'.$package->getName();
}
return rtrim($installDir, '/');
}
b) A possible bug for future in IgnoreFactory:create() Ln 44
if ($packageName === $package->getName()) {
static::addPatterns($manager, $patterns);
break;
}
above code fails for
{
"require":{
"bower-asset/jquery-ajaxQueue"
},
"asset-ignore-files": {
"bower-asset/jquery-ajaxQueue": []
}
}
because :$package->getName()
returns bower-asset/jquery-ajaxqueue
while converting all characters to small case, I am not sure if that is part of composer standard.
Alas, yes, it's the standard of Composer, and that's a problem ...
Let say I have following composer.json
I have defined both
vendor-dir
as well asasset-installer-paths
, given that , composer fails to delete ignore files defined inasset-ignore-files
list.problem seems to be
Installer/IgnoreFactory.php
class which does not account for the both directory settings, to be specific getInstallDirI think it makes sense to have different paths for
vendor-dir
andasset-installer-paths
, as I dont want to putvendor-dir
on web accessible path.thanks