Skip to content

Commit

Permalink
♻️ fixed test for reload api option
Browse files Browse the repository at this point in the history
Signed-off-by: bnomei <[email protected]>
  • Loading branch information
bnomei committed Sep 3, 2024
1 parent 92c1654 commit 29d738d
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 168 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bnomei/kirby3-janitor",
"type": "kirby-plugin",
"version": "4.4.0",
"version": "4.4.1",
"license": "MIT",
"homepage": "https://github.com/bnomei/kirby3-janitor",
"description": "Kirby Plugin for running commands like cleaning the cache from within the Panel, PHP code or a cronjob",
Expand Down
308 changes: 154 additions & 154 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/fields/Janitor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default {
return;
}
this.postRequest("plugin-janitor", { command: this.command });
await this.postRequest("plugin-janitor", { command: this.command });
},
async postRequest(path, data) {
Expand Down
3 changes: 0 additions & 3 deletions tests/site/commands/reload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<?php

use Bnomei\Janitor;
Expand All @@ -10,8 +9,6 @@
'command' => static function (CLI $cli): void {
$cli->error('No reload in CLI.');

ray('reload', $cli->args());

janitor()->data($cli->arg('command'), [
'status' => 200,
'reload' => true, // will trigger JS location.reload in panel
Expand Down
7 changes: 7 additions & 0 deletions tests/site/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
],
],

// DO NOT USE BASIC AUTH IN PRODUCTION
// I only use this in my dev env to test the janitor commands
'api' => [
'basicAuth' => true,
'allowInsecure' => true,
],

'bnomei.janitor.secret' => 'e9fe51f94eadabf54',

// janitor v2 job callback
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'bnomei/kirby3-janitor',
'pretty_version' => '4.4.0',
'version' => '4.4.0.0',
'pretty_version' => '4.4.1',
'version' => '4.4.1.0',
'reference' => null,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
Expand All @@ -11,8 +11,8 @@
),
'versions' => array(
'bnomei/kirby3-janitor' => array(
'pretty_version' => '4.4.0',
'version' => '4.4.0.0',
'pretty_version' => '4.4.1',
'version' => '4.4.1.0',
'reference' => null,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
Expand All @@ -38,9 +38,9 @@
'dev_requirement' => false,
),
'symfony/finder' => array(
'pretty_version' => 'v7.1.3',
'version' => '7.1.3.0',
'reference' => '717c6329886f32dc65e27461f80f2a465412fdca',
'pretty_version' => 'v7.1.4',
'version' => '7.1.4.0',
'reference' => 'd95bbf319f7d052082fb7af147e0f835a695e823',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/finder',
'aliases' => array(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ public function current(): SplFileInfo
$subPathname .= $this->directorySeparator;
}
$subPathname .= $this->getFilename();
$basePath = $this->rootPath;

if ('/' !== $basePath = $this->rootPath) {
if ('/' !== $basePath && !str_ends_with($basePath, $this->directorySeparator) && !str_ends_with($basePath, '/')) {
$basePath .= $this->directorySeparator;
}

Expand Down

0 comments on commit 29d738d

Please sign in to comment.