"feat: 升级本地应用管理依赖,新增应用删除功能及强制覆盖下载选项"

This commit is contained in:
2025-05-17 15:53:06 +08:00
parent 035ddc248c
commit e9eedcd1bd
9 changed files with 99 additions and 18 deletions

View File

@@ -35,6 +35,8 @@ type DownloadAppOptions = {
* 应用名称,默认为 user/app的 app
*/
appName?: string;
force?: boolean;
yes?: boolean;
};
type DeleteAppOptions = {
/**
@@ -53,7 +55,7 @@ export class AppDownload {
this.config = config;
}
async downloadApp(opts: DownloadAppOptions) {
const { id, type = 'web' } = opts;
const { id, type = 'web', force } = opts;
const configDir = this.config.configDir;
this.config?.checkMounted();
const appsDir = this.config.configPath?.appsDir;
@@ -75,6 +77,12 @@ export class AppDownload {
} else {
throw new Error('应用类型错误,只能是 web 或 app');
}
if (force) {
args.push('-f');
if (opts.yes) {
args.push('-y');
}
}
if (opts.registry) {
args.push('-r', opts.registry);
}