mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
console build 命令支持 使用 --module 模块名 方式生成默认模块目录
This commit is contained in:
@@ -156,7 +156,7 @@ class Build
|
|||||||
{
|
{
|
||||||
$filename = APP_PATH . ($module ? $module . DS : '') . 'config.php';
|
$filename = APP_PATH . ($module ? $module . DS : '') . 'config.php';
|
||||||
if (!is_file($filename)) {
|
if (!is_file($filename)) {
|
||||||
file_put_contents($filename, "<?php\nreturn [\n\n];");
|
file_put_contents($filename, "<?php\n//配置文件\nreturn [\n\n];");
|
||||||
}
|
}
|
||||||
$filename = APP_PATH . ($module ? $module . DS : '') . 'common.php';
|
$filename = APP_PATH . ($module ? $module . DS : '') . 'common.php';
|
||||||
if (!is_file($filename)) {
|
if (!is_file($filename)) {
|
||||||
|
|||||||
@@ -24,12 +24,18 @@ class Build extends Command
|
|||||||
protected function configure()
|
protected function configure()
|
||||||
{
|
{
|
||||||
$this->setName('build')
|
$this->setName('build')
|
||||||
->setDefinition([new Option('config', null, Option::VALUE_OPTIONAL, "build.php path", APP_PATH . 'build.php')])
|
->setDefinition([new Option('config', null, Option::VALUE_OPTIONAL, "build.php path", APP_PATH . 'build.php')])
|
||||||
->setDescription('Build Application Dirs');
|
->setDefinition([new Option('module', null, Option::VALUE_OPTIONAL, "module name", 'index')])
|
||||||
|
->setDescription('Build Application Dirs');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(Input $input, Output $output)
|
protected function execute(Input $input, Output $output)
|
||||||
{
|
{
|
||||||
|
if ($input->hasOption('module')) {
|
||||||
|
\think\Build::module($input->getOption('module'));
|
||||||
|
$output->writeln("Successed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($input->hasOption('config')) {
|
if ($input->hasOption('config')) {
|
||||||
$build = include $input->getOption('config');
|
$build = include $input->getOption('config');
|
||||||
|
|||||||
Reference in New Issue
Block a user