Skip to content

Commit

Permalink
Modify the deprecation notice for internal use of Module/Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mallorydxw committed Apr 6, 2016
1 parent 7464718 commit 757302c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
40 changes: 23 additions & 17 deletions src/Modules/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,28 @@ public function commands()
$this->command('upgrade [PLUGIN]', 'Upgrades PLUGIN to the most recent available version, or to the version specified in your Plugin file.');
}

private function deprecationNotice()
private function deprecationNotice($internal)
{
$this->warningText(array_merge([
'The plugins subcommand is deprecated and will be removed in a future release.',
'',
'To migrate a `plugins` file to a `whippet.json` file, run the following:',
' $ whippet deps migrate',
'',
'Once you have a `whippet.json` file, you can run the following instead of `whippet plugins upgrade`:',
' $ whippet deps update',
'',
'And the following instead of `whippet plugins install`:',
' $ whippet deps install',
'',
'',
]));
if ($internal) {
$this->warningText([
'Notice: Using a deprecated `plugins` file.',
]);
} else {
$this->warningText([
'The plugins subcommand is deprecated and will be removed in a future release.',
'',
'To migrate a `plugins` file to a `whippet.json` file, run the following:',
' $ whippet deps migrate',
'',
'Once you have a `whippet.json` file, you can run the following instead of `whippet plugins upgrade`:',
' $ whippet deps update',
'',
'And the following instead of `whippet plugins install`:',
' $ whippet deps install',
'',
'',
]);
}
}

private function warningText($lines)
Expand All @@ -48,9 +54,9 @@ private function warningText($lines)
* This command will not change an installed commit unless the revision has changed. It
* just makes sure that what's in the project is what's in the file.
*/
public function install()
public function install($internal = false)
{
$this->deprecationNotice();
$this->deprecationNotice($internal);
$this->whippet_init();
$this->load_plugins_manifest();
$this->load_plugins_lock();
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/Release.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function create(&$force)
}

// Make sure wp-content is up to date
$result = $installer->install();
$result = $installer->install(true);
if ($result->isErr()) {
echo sprintf("ERROR: %s\n", $result->getErr());
exit(1);
Expand Down

0 comments on commit 757302c

Please sign in to comment.