This commit is contained in:
cheney 2026-06-17 10:46:31 +08:00
parent 4207d6e467
commit 37fa4cf020

View File

@ -96,10 +96,24 @@ async function main(){
} }
}); });
parser.addCmdLine("check", "验证远程仓库可达;", async function () { parser.addCmdLine("check [module]", "验证远程仓库可达;指定 module 时查看远程 meta 信息;", async function (cli) {
const remote = await getAvailableRemote(); const remote = await getAvailableRemote();
if (remote) { if (!remote) {
return;
}
const module = cli.getParamValue("module");
if (!module) {
$logger.info("远程仓库可用"); $logger.info("远程仓库可用");
return;
}
try {
const parsed = remote.parseProjectVersion(module);
const meta = await remote.getProjectMetadata(parsed.projectId, parsed.group);
$logger.info(JSON.stringify(meta, null, 4));
} catch (e) {
$logger.info(`远程 module 不存在: ${module}`);
} }
}); });
@ -168,3 +182,4 @@ async function main(){
}); });
} }
} }