Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
add composer.extra.component support
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jun 17, 2016
1 parent a71d719 commit 89c7849
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Artist/PackagesnavJsalias.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,21 @@ protected function exec(){
$packageName = basename($p);
if(in_array($packageName,$this->exclude)) continue;
if(isset($alias[$packageName])&&!$force) continue;
if(!is_file($jsonFile=$p.'/bower.json')&&!is_file($jsonFile=$p.'/component.json')) continue;
$json = json_decode(file_get_contents($jsonFile),true);
if(!isset($json['main'])) continue;
if(is_file($jsonFile=$p.'/bower.json')||is_file($jsonFile=$p.'/component.json')){
$json = json_decode(file_get_contents($jsonFile),true);
if(!isset($json['main'])) continue;
$mainJson = $json['main'];
}
elseif(is_file($jsonFile=$p.'/composer.json')){
$json = json_decode(file_get_contents($jsonFile),true);
if(!isset($json['extra']['component']['scripts'])) continue;
$mainJson = $json['extra']['component']['scripts'];
}
else{
continue;
}
$mainJs = [];
foreach((array)$json['main'] as $main){
foreach((array)$mainJson as $main){
if(strtolower(pathinfo($main,PATHINFO_EXTENSION))=='js'){
$mainJs[] = self::cleanDotInUrl($packagesDir.'/'.$packageName.'/'.substr($main,0,-3));
}
Expand Down

0 comments on commit 89c7849

Please sign in to comment.