Skip to content

Commit

Permalink
Improved error message when running bin/grav install instead of `bi…
Browse files Browse the repository at this point in the history
…n/gpm install`, and also when running on a non-skeleton site #1027

```
$ bin/grav install
HINT Are you trying to install Grav? Grav is already installed. You
need to run this command only if you download a skeleton from GitHub
directly.

$ bin/grav install admin
HINT Are you trying to install a plugin or a theme? Make sure you use
bin/gpm install <something>, not bin/grav install. This command is only
used to install Grav skeletons.
```
  • Loading branch information
flaviocopes committed Jun 6, 2017
1 parent 354ef34 commit 947c920
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
1. [](#improved)
* Optionally remove unpublished pages from the translated languages, move into untranslated list [#1482](https://github.com/getgrav/grav/pull/1482)
* Improved reliability of `hash` file-check method
* Improved error message when running `bin/grav install` instead of `bin/gpm install`, and also when running on a non-skeleton site [#1027](https://github.com/getgrav/grav/issues/1027)
1. [](#bugfix)
* Updated to latest Toolbox library to fix issue with some blueprints rendering in admin plugin [#1117](https://github.com/getgrav/grav-plugin-admin/issues/1117)
* Fix output handling in RenderProcessor [#1483](https://github.com/getgrav/grav/pull/1483)
Expand Down
7 changes: 7 additions & 0 deletions system/src/Grav/Console/Cli/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ protected function serve()
$this->config = Yaml::parse(file_get_contents($this->destination . $dependencies_file));
} else {
$this->output->writeln('<red>ERROR</red> Missing .dependencies file in <cyan>user/</cyan> folder');
if ($this->input->getArgument('destination')) {
$this->output->writeln('<yellow>HINT</yellow> <info>Are you trying to install a plugin or a theme? Make sure you use <cyan>bin/gpm install <something></cyan>, not <cyan>bin/grav install</cyan>. This command is only used to install Grav skeletons.');
} else {
$this->output->writeln('<yellow>HINT</yellow> <info>Are you trying to install Grav? Grav is already installed. You need to run this command only if you download a skeleton from GitHub directly.');
}

return;
}

// If yaml config, process
Expand Down

0 comments on commit 947c920

Please sign in to comment.