fix: metadata
This commit is contained in:
		| @@ -155,7 +155,7 @@ export class SyncBase { | ||||
|     let obj: Record<string, any> = {}; | ||||
|     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 }; | ||||
|         } | ||||
|       } | ||||
|     } | ||||
|   | ||||
| @@ -2,7 +2,7 @@ export type SyncConfigType = 'sync' | 'download' | 'upload' | 'none'; | ||||
| export type SyncConfig = { | ||||
|   type?: SyncConfigType; // 是否可以同步 | ||||
|   url: string; // 文件具体的 url 的地址 | ||||
|   meta?: Record<string, any>; // 元数据 | ||||
|   metadata?: Record<string, any>; // 元数据 | ||||
| }; | ||||
| export type SyncDirectory = { | ||||
|   /** | ||||
| @@ -16,7 +16,7 @@ export type SyncDirectory = { | ||||
|   registry?: string; | ||||
|   files?: string[]; | ||||
|   replace?: Record<string, string>; | ||||
|   meta?: Record<string, any>; | ||||
|   metadata?: Record<string, any>; | ||||
| }; | ||||
| export interface Config { | ||||
|   name?: string; // 项目名称 | ||||
|   | ||||
| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user