清理部分无用的代码;调整更新逻辑;发布新版本

This commit is contained in:
2023-09-23 18:05:41 +08:00
parent 44edefb37b
commit afd570b910
44 changed files with 30 additions and 1623 deletions

View File

@@ -251,7 +251,7 @@ class Update extends Command
}
foreach ($last_version_skip_config['append_dir'] as $dir) {
if(str_starts_with($file_path,$dir)){
if (str_starts_with($file_path, $dir)) {
$last_version_list_append_files[] = $file_path;
continue;
}
@@ -259,10 +259,10 @@ class Update extends Command
}
foreach ($last_version_list_append_files as $file_path) {
$now_file_path = $now_dir. '/'. $file_path;
$last_file_path = $last_version_dir. '/'. $file_path;
$now_file_path = $now_dir . '/' . $file_path;
$last_file_path = $last_version_dir . '/' . $file_path;
if(file_exists($now_file_path)){
if (file_exists($now_file_path)) {
continue;
}
@@ -286,6 +286,12 @@ class Update extends Command
$this->cleanWorkpaceDir();
$output->writeln('更新完成');
// 更新完成
if (!empty(Version::UPDATE_TIPS)) {
foreach (Version::UPDATE_TIPS as $content) {
$output->writeln($content);
}
}
}
protected function cleanWorkpaceDir()

View File

@@ -7,10 +7,8 @@ namespace app\common\command\admin;
use think\App as ThinkApp;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\App;
class Version extends Command
{
@@ -23,6 +21,11 @@ class Version extends Command
'发布新版本',
];
public const UPDATE_TIPS = [
'本次调整了append类型的更新文件列表',
'建议删除以下目录的内容,再重新获取更新,以便初始化相关类,但如果您定制了相关文件,请不要删除,可以参考最新版本的代码调整文件',
];
protected function configure()
{
// 指令配置
@@ -33,7 +36,6 @@ class Version extends Command
protected function execute(Input $input, Output $output)
{
// 指令输出
$output->info('当前版本号为:' . $this::VERSION);
$output->info('当前Layui版本号为' . $this::LAYUI_VERSION);
@@ -56,12 +58,12 @@ class Version extends Command
$output->writeln('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>');
$version = $this::VERSION;
$comment = implode(";", $this::COMMENT);
$comment = implode(';', $this::COMMENT);
$output->info('生成标签:' . $version);
$output->info('标签描述:' . $comment);
exec("git tag -a $version -m \"$comment\"");
$output->info('推送到远程仓库');
exec("git push --tags");
exec('git push --tags');
}
}
}