File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ namespace Deployer;
1010
1111use Deployer \Documentation \ApiGen ;
1212use Deployer \Documentation \DocGen ;
13+ use Deployer \Import \MamlRecipe ;
14+ use Maml \Maml ;
1315use Symfony \Component \Console \Application ;
1416use Symfony \Component \Console \Input \ArgvInput ;
1517use Symfony \Component \Console \Output \ConsoleOutput ;
@@ -47,11 +49,23 @@ $recipes = function () use ($input, $output): int {
4749 return 0 ;
4850};
4951
52+ $ schema = function () use ($ output ): int {
53+ $ newSchema = [
54+ '$id ' => "https://deployer.org/schema.json# " ,
55+ ...Maml::jsonSchema (MamlRecipe::schema ()),
56+ ];
57+ file_put_contents (__DIR__ . '/../src/schema.json ' , json_encode ($ newSchema , JSON_PRETTY_PRINT ));
58+ $ output ->writeln ('Schema updated. ' );
59+ return 0 ;
60+ };
61+
5062$ app ->register ('api ' )->setCode ($ api );
5163$ app ->register ('recipes ' )->setCode ($ recipes )->addOption ('json ' );
52- $ app ->register ('all ' )->setCode (function () use ($ recipes , $ api ): int {
64+ $ app ->register ('schema ' )->setCode ($ schema );
65+ $ app ->register ('all ' )->setCode (function () use ($ schema , $ recipes , $ api ): int {
5366 $ api ();
5467 $ recipes ();
68+ $ schema ();
5569 echo shell_exec ('git status ' );
5670 return 0 ;
5771})->addOption ('json ' );
You can’t perform that action at this time.
0 commit comments