Skip to content

Commit

Permalink
Reorganise workbench install scripts (#11)
Browse files Browse the repository at this point in the history
* Reorganise workbench install scripts

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Aug 18, 2023
1 parent 3159ea6 commit 865ac1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
11 changes: 3 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"scripts": {
"post-autoload-dump": [
"@composer run clear",
"@composer run prepare"
"@clear",
"@prepare"
],
"ci": [
"@composer audit",
Expand All @@ -55,12 +55,7 @@
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build",
"serve": [
"@composer run clear",
"@composer run prepare",
"@composer run build",
"@php vendor/bin/testbench serve"
],
"serve": "@php vendor/bin/testbench serve",
"lint": [
"@composer run prepare",
"@php vendor/bin/pint",
Expand Down
21 changes: 8 additions & 13 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,9 @@ protected function appendScriptsToComposer(array $content, Filesystem $filesyste
$content['scripts'] = [];
}

$content['scripts']['clear'] = '@php vendor/bin/testbench package:purge-skeleton --ansi';
$content['scripts']['prepare'] = '@php vendor/bin/testbench package:discover --ansi';
$content['scripts']['build'] = '@php vendor/bin/testbench workbench:build';
$content['scripts']['serve'] = [
'@composer run clear',
'@composer run prepare',
'@composer run build',
'@php vendor/bin/testbench serve',
];

$postAutoloadDumpScripts = [
'@composer run clear',
'@composer run prepare',
'@clear',
'@prepare',
];

if (! \array_key_exists('post-autoload-dump', $content['scripts'])) {
Expand All @@ -113,6 +103,11 @@ protected function appendScriptsToComposer(array $content, Filesystem $filesyste
]);
}

$content['scripts']['clear'] = '@php vendor/bin/testbench package:purge-skeleton --ansi';
$content['scripts']['prepare'] = '@php vendor/bin/testbench package:discover --ansi';
$content['scripts']['build'] = '@php vendor/bin/testbench workbench:build';
$content['scripts']['serve'] = '@php vendor/bin/testbench serve';

if (! \array_key_exists('lint', $content['scripts'])) {
$lintScripts = [];

Expand All @@ -128,7 +123,7 @@ protected function appendScriptsToComposer(array $content, Filesystem $filesyste

if (\count($lintScripts) > 0) {
$content['scripts']['lint'] = [
'@composer run prepare',
'@prepare',
...$lintScripts,
];
}
Expand Down

0 comments on commit 865ac1f

Please sign in to comment.