/**
* @param string $type the package type. Can be either `bower` or `npm`
* @param string $name the package name
* @return boolean Whether the update was successful
*/
public function actionUpdate($type, $name)
{
try {
$package = new AssetPackage($type, $name);
Yii::createObject(PackageUpdateCommand::class, [$package])->run();
echo 'updated ' . $package->getHash() . ' ' . $package->getFullName() . "\n";
return true;
} catch (\Exception $e) {
echo Console::renderColoredString("%Rfailed%N {$type}/{$name}:%n {$e->getMessage()}\n");
return false;
}
}