基本完成生成命令

This commit is contained in:
2022-10-21 20:23:47 +08:00
parent 2d54586f09
commit 9db8fe1d5f
8 changed files with 179 additions and 155 deletions

View File

@@ -82,7 +82,7 @@ class Component extends Command
$index_scss = '';
foreach ($dir_tpl as $dir_name) {
if ($dir_name == '.' || $dir_name == '..') {
if ($dir_name == '.' || $dir_name == '..' || $dir_name == '_index.scss') {
continue;
}
@@ -94,10 +94,10 @@ class Component extends Command
continue;
}
$index_scss .= "@import './{$dir_name}/{$component_name}/index';";
$index_scss .= "@import './{$dir_name}/{$component_name}/index';\n";
}
}
file_put_contents(App::getRootPath() . '/source/components/_index.scss');
file_put_contents(App::getRootPath() . '/source/components/_index.scss', $index_scss);
}
}