if ($plugin->
getInstalled()) { $output->
writeln('The Plugin has to be uninstalled first.'
);
return 1;
} $pluginPath =
$pluginManager->
getPluginPath($pluginName);
$message = null;
if ($plugin->
getSource() === 'Default'
) { $message = "'Default' Plugins may not be deleted.";
} elseif (!
$this->
deletePath($pluginPath)) { $message = 'Plugin path "' .
$pluginPath . '" could not be deleted.';
} else { Shopware()->
Models()->
remove($plugin);
Shopware()->
Models()->
flush();
} if ($message) { $output->
writeln($message);
return 1;
}