t-comm
Version:
专业、稳定、纯粹的工具库
27 lines (26 loc) • 800 B
TypeScript
/**
* 获取复制目标路径
* @param copySourceDir 复制源目录,注意,这里是绝对路径
* @param domainDir 域名目录,注意,这里是绝对路径
* @returns 要复制的列表,注意,这里是相对路径,如 ['os-x/en', 'os-x/zh-hant']
* @example
* ```ts
* // 假设 /tmp/dist/os-x 下有 en、zh-hans、zh-hant 三个语言目录
* getCopyTargetDirs(
* '/tmp/dist/os-x/zh-hans',
* '/tmp/dist',
* );
* // ['os-x/en', 'os-x/zh-hant']
*
* // 仅保留指定前缀
* getCopyTargetDirs(
* '/tmp/dist/os-x/zh-hans',
* '/tmp/dist',
* { copyTargetPrefix: 'os-x/zh-' },
* );
* // ['os-x/zh-hant']
* ```
*/
export declare function getCopyTargetDirs(copySourceDir: string, domainDir: string, options?: {
copyTargetPrefix?: string;
}): string[];