Skip to content

Commit ffdd3a1

Browse files
committed
Merge branch 'release/1.5.4'
2 parents 535da04 + 515a6ce commit ffdd3a1

File tree

7 files changed

+34
-11
lines changed

7 files changed

+34
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v1.5.4
2+
## 10/26/2021
3+
4+
1. [](#improved)
5+
* Moved offline check to CLI flag [#70](https://github.com/getgrav/grav-plugin-devtools/issues/70)
6+
* Updated footer copyrights for Pure Blank
7+
18
# v1.5.3
29
## 06/16/2021
310

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ There are **three template creation options**
6969
2. `inheritance` - This creates a very basic template with minimal files that inherits a base theme. To find out more about theme inheritance, [check out the subject in more details on the Grav Learn site](https://learn.getgrav.org/themes/customization#theme-inheritance).
7070
3. `copy` - This allows you to create a new theme based on an existing theme. This is the simplest way to get started with a new theme by using another theme as the basis.
7171

72+
## Skipping Online Project Name Collision Checking
7273

74+
By default, devtools will check your project's name with the existing gpm ecosystem to ensure no collisions. In order to skip this check, add an `--offline` or `-o` to your command:
7375

76+
`bin/plugin devtools new-theme --offline`
77+
or
7478

79+
`bin/plugin devtools new-theme -o`

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: DevTools
22
slug: devtools
33
type: plugin
4-
version: 1.5.3
4+
version: 1.5.4
55
description: Plugin and Theme scaffolding utilities
66
icon: cogs
77
author:

classes/DevToolsCommand.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,24 +293,21 @@ protected function validateOptions(): void
293293
*/
294294
protected function validate(string $type, $value)
295295
{
296-
$grav = Grav::instance();
297-
$config = $grav['config'];
298296
switch ($type) {
299297
case 'name':
300298
// Check If name
301299
if ($value === null || trim($value) === '') {
302300
throw new \RuntimeException('Name cannot be empty');
303301
}
304302

305-
// Check for name collision with online gpm.
306-
$collision_check = $config->get('plugins.devtools.collision_check');
307-
if ( $collision_check == true) {
303+
if (!$this->options['offline']) {
304+
// Check for name collision with online gpm.
308305
if (false !== $this->gpm->findPackage($value)) {
309306
throw new \RuntimeException('Package name exists in GPM');
310307
}
311308
} else {
312-
$this->output->writeln('<red>Warning</red>: Devtools is configured for "<cyan>collision_check</cyan>: <red>false</red>".');
313-
$this->output->writeln('Please be aware that your project\'s plugin or theme name may conflict with an existing plugin or theme.');
309+
$this->output->writeln('');
310+
$this->output->writeln(' <red>Warning</red>: Please note that by skipping the online check, your project\'s plugin or theme name may conflict with an existing plugin or theme.');
314311
}
315312

316313
// Check if it's reserved

cli/NewPluginCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ protected function configure(): void
5151
InputOption::VALUE_OPTIONAL,
5252
'The developer\'s email'
5353
)
54+
->addOption(
55+
'offline',
56+
'o',
57+
InputOption::VALUE_NONE,
58+
'Skip online name collision check'
59+
)
5460
->setDescription('Creates a new Grav plugin with the basic required files')
5561
->setHelp('The <info>new-plugin</info> command creates a new Grav instance and performs the creation of a plugin.');
5662
}
@@ -76,7 +82,8 @@ protected function serve(): int
7682
'name' => $input->getOption('dev'),
7783
'email' => $input->getOption('email'),
7884
'githubid' => $input->getOption('github')
79-
]
85+
],
86+
'offline' => $input->getOption('offline'),
8087
];
8188

8289
$this->validateOptions();

cli/NewThemeCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ protected function configure(): void
5252
InputOption::VALUE_OPTIONAL,
5353
'The developer\'s email'
5454
)
55+
->addOption(
56+
'offline',
57+
'o',
58+
InputOption::VALUE_NONE,
59+
'Skip online name collision check'
60+
)
5561
->setDescription('Creates a new Grav theme with the basic required files')
5662
->setHelp('The <info>new-theme</info> command creates a new Grav instance and performs the creation of a theme.');
5763
}
@@ -77,7 +83,8 @@ protected function serve(): int
7783
'name' => $input->getOption('dev'),
7884
'email' => $input->getOption('email'),
7985
'githubid' => $input->getOption('github'),
80-
]
86+
],
87+
'offline' => $input->getOption('offline'),
8188
];
8289

8390
$this->validateOptions();

components/theme/pure-blank/templates/partials/base.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
{% block footer %}
5858
<div class="footer text-center">
5959
<div class="wrapper padding">
60-
<p><a href="https://getgrav.org">Grav</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="https://rockettheme.com">RocketTheme</a>.</p>
60+
<p><a href="https://getgrav.org">Grav</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="https://trilby.media">Trilby Media, LLC</a>.</p>
6161
</div>
6262
</div>
6363
{% endblock %}

0 commit comments

Comments
 (0)