Skip to content

Commit

Permalink
ignore new plugins during translation update
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Jan 31, 2014
1 parent 29ee9c8 commit bfb3f16
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/LanguagesManager/Commands/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,20 @@ public static function getPluginsInCore()
preg_match_all('/plugins\/([a-zA-z]+) /', $submodules, $matches);
$submodulePlugins = $matches[1];

// ignore complete new plugins aswell
$changes = shell_exec('git status');
preg_match_all('/plugins\/([a-zA-z]+)\/\n/', $changes, $matches);
$newPlugins = $matches[1];

$pluginsNotInCore = array_merge($submodulePlugins, $newPlugins);

$pluginsWithTranslations = glob(sprintf('%s/plugins/*/lang/en.json', PIWIK_INCLUDE_PATH));
$pluginsWithTranslations = array_map(function($elem){
return str_replace(array(sprintf('%s/plugins/', PIWIK_INCLUDE_PATH), '/lang/en.json'), '', $elem);
}, $pluginsWithTranslations);

$pluginsInCore = array_diff($pluginsWithTranslations, $submodulePlugins);
$pluginsInCore = array_diff($pluginsWithTranslations, $pluginsNotInCore);

return $pluginsInCore;
}
}
}

0 comments on commit bfb3f16

Please sign in to comment.