first commit
This commit is contained in:
47
src/Commands/ApolloConfigSync.php
Normal file
47
src/Commands/ApolloConfigSync.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace StarPoolCloud\Commands;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ApolloConfigSync extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'apollo:sync';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = '同步Apollo配置';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
app('StarPoolCloudApollo')->updateEnv();
|
||||
$this->info('Success');
|
||||
} catch (Exception $exception) {
|
||||
$this->error("Error:{$exception->getMessage()}");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user