File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 3
3
namespace Codebarista \LaravelEcharts \Console \Commands ;
4
4
5
5
use Illuminate \Console \Command ;
6
+ use Illuminate \Contracts \Console \Isolatable ;
6
7
use Illuminate \Support \Facades \Process ;
7
8
use Throwable ;
8
9
9
- class NodeEcharts extends Command
10
+ class NodeEcharts extends Command implements Isolatable
10
11
{
11
- /**
12
- * The name and signature of the console command.
13
- *
12
+ /***
14
13
* @var string
15
14
*/
16
15
protected $ signature = 'codebarista:node-echarts {action} ' ;
17
16
18
- /**
19
- * The console command description.
20
- *
17
+ /***
21
18
* @var string
22
19
*/
23
20
protected $ description = 'Install or update Node canvas and echarts ' ;
24
21
25
- /**
26
- * Execute the console command.
27
- *
22
+ /***
28
23
* @throws Throwable
29
24
*/
30
25
public function handle (): int
31
26
{
32
27
$ action = $ this ->argument ('action ' );
33
28
34
29
$ process = Process::path (codebarista_path ('tools/echarts ' ))
30
+ ->timeout (180 )
35
31
->run (['npm ' , $ action ]);
36
32
37
33
throw_if ($ process ->failed (), $ process ->errorOutput ());
38
34
35
+ $ this ->components ->info ('Node echarts have been installed successfully. ' );
36
+
39
37
return self ::SUCCESS ;
40
38
}
41
39
}
You can’t perform that action at this time.
0 commit comments