mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 03:22:51 +08:00
调整更新逻辑;发布新版本
This commit is contained in:
@@ -11,6 +11,7 @@ use League\Flysystem\Local\LocalFilesystemAdapter;
|
|||||||
use League\Flysystem\StorageAttributes;
|
use League\Flysystem\StorageAttributes;
|
||||||
use think\console\Command;
|
use think\console\Command;
|
||||||
use think\console\Input;
|
use think\console\Input;
|
||||||
|
use think\console\input\Option;
|
||||||
use think\console\Output;
|
use think\console\Output;
|
||||||
use think\facade\App;
|
use think\facade\App;
|
||||||
use think\facade\Env;
|
use think\facade\Env;
|
||||||
@@ -23,6 +24,7 @@ class Update extends Command
|
|||||||
{
|
{
|
||||||
// 指令配置
|
// 指令配置
|
||||||
$this->setName('admin:update')
|
$this->setName('admin:update')
|
||||||
|
->addOption('reinstall', null, Option::VALUE_NONE, '重装版本')
|
||||||
->setDescription('the admin:update command');
|
->setDescription('the admin:update command');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,8 +72,12 @@ class Update extends Command
|
|||||||
$output->writeln('当前版本为最新版本');
|
$output->writeln('当前版本为最新版本');
|
||||||
$this->cleanWorkpaceDir();
|
$this->cleanWorkpaceDir();
|
||||||
|
|
||||||
|
if ($input->hasOption('reinstall')) {
|
||||||
|
$output->writeln('重装代码');
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 将最新代码切换到最新版本,因为最新的提交可能没有发布版本
|
// 将最新代码切换到最新版本,因为最新的提交可能没有发布版本
|
||||||
$output->writeln('切换最新代码的最新版本');
|
$output->writeln('切换最新代码的最新版本');
|
||||||
@@ -193,7 +199,7 @@ class Update extends Command
|
|||||||
->map(fn (StorageAttributes $attributes) => $attributes->path())
|
->map(fn (StorageAttributes $attributes) => $attributes->path())
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
$delete_files = array_diff($last_version_list_files, $current_version_list_files);
|
$delete_files = array_diff($current_version_list_files, $last_version_list_files);
|
||||||
|
|
||||||
foreach ($delete_files as $file_path) {
|
foreach ($delete_files as $file_path) {
|
||||||
$now_file_path = $now_dir . '/' . $file_path;
|
$now_file_path = $now_dir . '/' . $file_path;
|
||||||
@@ -291,6 +297,8 @@ class Update extends Command
|
|||||||
foreach (Version::UPDATE_TIPS as $content) {
|
foreach (Version::UPDATE_TIPS as $content) {
|
||||||
$output->writeln($content);
|
$output->writeln($content);
|
||||||
}
|
}
|
||||||
|
$output->writeln('删除对应文件之后,可以通过以下命令重新安装');
|
||||||
|
$output->writeln('php think admin:update --resinstall');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ use think\console\Output;
|
|||||||
|
|
||||||
class Version extends Command
|
class Version extends Command
|
||||||
{
|
{
|
||||||
public const VERSION = 'v2.0.42';
|
public const VERSION = 'v2.0.43';
|
||||||
|
|
||||||
public const LAYUI_VERSION = '2.8.16';
|
public const LAYUI_VERSION = '2.8.16';
|
||||||
|
|
||||||
public const COMMENT = [
|
public const COMMENT = [
|
||||||
'删除无用文件',
|
'调整更新逻辑',
|
||||||
'发布新版本',
|
'发布新版本',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user