update change cli

This commit is contained in:
2025-05-23 23:55:04 +08:00
parent 89860261f9
commit 5d5650b3d0
12 changed files with 261 additions and 366 deletions

View File

@@ -152,10 +152,10 @@ export class SyncBase {
async getSyncDirectoryList() {
const config = this.config;
const syncDirectory = config?.syncDirectory || [];
let obj: Record<string, string> = {};
let obj: Record<string, any> = {};
const keys: string[] = [];
for (let item of syncDirectory) {
const { registry, ignore = [], files = [], replace = {} } = item;
const { registry, ignore = [], files = [], replace = {}, meta } = item;
const cwd = this.#dir;
const glob_files = await glob(files, {
ignore: this.getIngore(ignore),
@@ -182,7 +182,10 @@ export class SyncBase {
const pathname = path.join(_registryURL.pathname, newKey);
_registryURL.pathname = pathname;
keys.push(key);
obj[key] = _registryURL.toString();
obj[key] = { url: _registryURL.toString() };
if (meta) {
obj[key] = { ...obj[key], meta };
}
}
}
return { sync: obj, keys };