hiqdev\assetpackagist\console\AssetPackageController::actionUpdate PHP Method

actionUpdate() public method

public actionUpdate ( string $type, string $name ) : boolean
$type string the package type. Can be either `bower` or `npm`
$name string 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;
        }
    }