Skip to content

Commit

Permalink
Merge pull request #985 from hydephp/update-UpdateConfigsCommand-command
Browse files Browse the repository at this point in the history
Change `update:configs` command to `publish:configs`
  • Loading branch information
caendesilva authored Feb 12, 2023
2 parents ad96cc6 + 0742a9e commit dcf0266
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/digging-deeper/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Based on [this blog post](https://github.com/hydephp/DocsCI/blob/ff4589b175c2794
| Issues with date in blog post front matter | The date is parsed by the PHP strtotime() function. The date may be in an invalid format, or the front matter is invalid | Ensure the date is in a format that strtotime() can parse. Wrap the front matter value in quotes. |
| RSS feed not being generated | The RSS feed requires that you have set a site URL in the Hyde config or the .env file. Also check that you have blog posts, and that they are enabled. | Check your configuration files. | |
| Sitemap not being generated | The sitemap requires that you have set a site URL in the Hyde config or the .env file. | Check your configuration files. | |
| Unable to do literally anything | If everything is broken, you may be missing a Composer package or your configuration files could be messed up. | Run `composer install` and/or `composer update`. If you can run HydeCLI commands, update your configs with `php hyde update:configs`, or copy them manually from GitHub or the vendor directory. |
| Unable to do literally anything | If everything is broken, you may be missing a Composer package or your configuration files could be messed up. | Run `composer install` and/or `composer update`. If you can run HydeCLI commands, update your configs with `php hyde publish:configs`, or copy them manually from GitHub or the vendor directory. |

### Extra troubleshooting information

Expand Down
2 changes: 1 addition & 1 deletion docs/digging-deeper/updating-hyde.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Next, follow the post-update instructions for Hyde/Hyde. After verifying that ev
After updating Hyde you should update your config and resource files. This is where things can get a tiny bit dangerous as the files will be overwritten. However, since you should be using Git, you can take care of any merge conflicts that arise.

```bash
php hyde update:configs
php hyde publish:configs
php hyde update:assets
```

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/console-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Note that when a view is updated in the framework you will need to republish the

### Republish the configuration files
```bash
php hyde update:configs
php hyde publish:configs
```

When updating Hyde to a new version (or if you mess up your config files),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@
*
* @see \Hyde\Framework\Testing\Feature\Commands\UpdateConfigsCommandTest
*/
class UpdateConfigsCommand extends Command
class PublishConfigsCommand extends Command
{
/** @var string */
protected $signature = 'update:configs';
protected $signature = 'publish:configs';

/** @var string */
protected $description = 'Publish the default configuration files';

/** @var bool */
protected $hidden = true;

public function handle(): int
{
Artisan::call('vendor:publish', [
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/src/Console/ConsoleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function register(): void
Commands\MakePostCommand::class,

Commands\VendorPublishCommand::class,
Commands\PublishConfigsCommand::class,
Commands\PublishHomepageCommand::class,
Commands\PublishViewsCommand::class,
Commands\UpdateConfigsCommand::class,
Commands\PackageDiscoverCommand::class,

Commands\RouteListCommand::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use Illuminate\Support\Facades\File;

/**
* @covers \Hyde\Console\Commands\UpdateConfigsCommand
* @covers \Hyde\Console\Commands\PublishConfigsCommand
*/
class UpdateConfigsCommandTest extends TestCase
class PublishConfigsCommandTest extends TestCase
{
public function setUp(): void
{
Expand All @@ -32,7 +32,7 @@ public function tearDown(): void

public function test_command_has_expected_output()
{
$this->artisan('update:configs')
$this->artisan('publish:configs')
->expectsOutput(sprintf('Published config files to [%s]', Hyde::path('config')))
->assertExitCode(0);
}
Expand All @@ -41,7 +41,7 @@ public function test_config_files_are_published()
{
$this->assertDirectoryDoesNotExist(Hyde::path('config'));

$this->artisan('update:configs')->assertExitCode(0);
$this->artisan('publish:configs')->assertExitCode(0);

$this->assertFileEquals(Hyde::vendorPath('config/hyde.php'), Hyde::path('config/hyde.php'));

Expand All @@ -53,7 +53,7 @@ public function test_command_overwrites_existing_files()
File::makeDirectory(Hyde::path('config'));
File::put(Hyde::path('config/hyde.php'), 'foo');

$this->artisan('update:configs')->assertExitCode(0);
$this->artisan('publish:configs')->assertExitCode(0);

$this->assertNotEquals('foo', File::get(Hyde::path('config/hyde.php')));
}
Expand Down
14 changes: 7 additions & 7 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,17 @@
<code>ServeCommand</code>
</PropertyNotSetInConstructor>
</file>
<file src="packages/framework/src/Console/Commands/UpdateConfigsCommand.php">
<file src="packages/framework/src/Console/Commands/PublishConfigsCommand.php">
<NonInvariantDocblockPropertyType occurrences="1">
<code>$description</code>
</NonInvariantDocblockPropertyType>
<PropertyNotSetInConstructor occurrences="6">
<code>UpdateConfigsCommand</code>
<code>UpdateConfigsCommand</code>
<code>UpdateConfigsCommand</code>
<code>UpdateConfigsCommand</code>
<code>UpdateConfigsCommand</code>
<code>UpdateConfigsCommand</code>
<code>PublishConfigsCommand</code>
<code>PublishConfigsCommand</code>
<code>PublishConfigsCommand</code>
<code>PublishConfigsCommand</code>
<code>PublishConfigsCommand</code>
<code>PublishConfigsCommand</code>
</PropertyNotSetInConstructor>
</file>
<file src="packages/framework/src/Console/Commands/ValidateCommand.php">
Expand Down

0 comments on commit dcf0266

Please sign in to comment.