File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class BlueprintCommand extends Command
16
16
*
17
17
* @var string
18
18
*/
19
- protected $ signature = 'blueprint:build {draft=draft.yaml } ' ;
19
+ protected $ signature = 'blueprint:build {draft? } ' ;
20
20
21
21
/**
22
22
* The console command description.
@@ -46,7 +46,8 @@ public function __construct(Filesystem $files)
46
46
*/
47
47
public function handle ()
48
48
{
49
- $ file = $ this ->argument ('draft ' );
49
+ $ file = $ this ->argument ('draft ' ) ?? $ this ->defaultDraftFile ();
50
+
50
51
if (!file_exists ($ file )) {
51
52
$ this ->error ('Draft file could not be found: ' . $ file );
52
53
}
@@ -96,4 +97,17 @@ private function outputStyle($action)
96
97
97
98
return 'info ' ;
98
99
}
100
+
101
+ private function defaultDraftFile ()
102
+ {
103
+ if (file_exists ('draft.yaml ' )) {
104
+ return 'draft.yaml ' ;
105
+ }
106
+
107
+ if (file_exists ('draft.yml ' )) {
108
+ return 'draft.yml ' ;
109
+ }
110
+
111
+ return null ;
112
+ }
99
113
}
You can’t perform that action at this time.
0 commit comments