Browse Source

调整

master
wuliangbo 11 months ago
parent
commit
0ce6723b9a
2 changed files with 3 additions and 7 deletions
  1. +1
    -1
      composer.json
  2. +2
    -6
      src/addons/command/SendConfig.php

+ 1
- 1
composer.json View File

@@ -34,7 +34,7 @@
},
"scripts" : {
"post-install-cmd": [
"php think addons:config"
"@php think addons:config"
]
}
}

+ 2
- 6
src/addons/command/SendConfig.php View File

@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace think\addons\command;

@@ -18,17 +19,13 @@ class SendConfig extends Command
public function execute(Input $input, Output $output)
{
//获取默认配置文件
$content = file_get_contents(root_path() . 'vendor/wuearl/think-addons/src/config.php');

$content = file_get_contents( __DIR__.'/../../config.php');
$configPath = config_path() . '/';
$configFile = $configPath . 'addons.php';


//判断目录是否存在
if (!file_exists($configPath)) {
mkdir($configPath, 0755, true);
}

//判断文件是否存在
if (is_file($configFile)) {
throw new \InvalidArgumentException(sprintf('The config file "%s" already exists', $configFile));
@@ -40,5 +37,4 @@ class SendConfig extends Command

$output->writeln('create addons config ok');
}

}

Loading…
Cancel
Save