diff --git a/src/command/sync/modules/base.ts b/src/command/sync/modules/base.ts index 7971e02..564a370 100644 --- a/src/command/sync/modules/base.ts +++ b/src/command/sync/modules/base.ts @@ -155,7 +155,7 @@ export class SyncBase { let obj: Record = {}; const keys: string[] = []; for (let item of syncDirectory) { - const { registry, ignore = [], files = [], replace = {}, meta } = item; + const { registry, ignore = [], files = [], replace = {}, metadata } = item; const cwd = this.#dir; const glob_files = await glob(files, { ignore: this.getIngore(ignore), @@ -183,8 +183,8 @@ export class SyncBase { _registryURL.pathname = pathname; keys.push(key); obj[key] = { url: _registryURL.toString() }; - if (meta) { - obj[key] = { ...obj[key], meta }; + if (metadata) { + obj[key] = { ...obj[key], metadata }; } } } diff --git a/src/command/sync/modules/type.ts b/src/command/sync/modules/type.ts index 9f71a43..3b1c2dd 100644 --- a/src/command/sync/modules/type.ts +++ b/src/command/sync/modules/type.ts @@ -2,7 +2,7 @@ export type SyncConfigType = 'sync' | 'download' | 'upload' | 'none'; export type SyncConfig = { type?: SyncConfigType; // 是否可以同步 url: string; // 文件具体的 url 的地址 - meta?: Record; // 元数据 + metadata?: Record; // 元数据 }; export type SyncDirectory = { /** @@ -16,7 +16,7 @@ export type SyncDirectory = { registry?: string; files?: string[]; replace?: Record; - meta?: Record; + metadata?: Record; }; export interface Config { name?: string; // 项目名称 diff --git a/src/command/sync/sync.ts b/src/command/sync/sync.ts index d389944..e75c94b 100644 --- a/src/command/sync/sync.ts +++ b/src/command/sync/sync.ts @@ -50,7 +50,7 @@ const syncUpload = new Command('upload') url: item.url, needHash: true, hash: item.hash, - meta: item.meta ?? meta, + meta: item.metadata ?? meta, }); if (res.code === 200) { if (res.data?.isNew) {