"feat: 同步功能增强与配置优化,支持多类型同步及日志分级"
This commit is contained in:
20
src/scripts/glob.ts
Normal file
20
src/scripts/glob.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { logger } from '@/module/logger.ts';
|
||||
import glob from 'fast-glob';
|
||||
import path from 'node:path';
|
||||
const root = process.cwd();
|
||||
|
||||
export const globFiles = async (pattern: string) => {
|
||||
const res = await glob(pattern, {
|
||||
cwd: root,
|
||||
onlyFiles: true,
|
||||
dot: true,
|
||||
// absolute: true,
|
||||
// ignore: ['build/01-summary.md'],
|
||||
});
|
||||
logger.info(`globFiles:,`, res);
|
||||
|
||||
const key = path.relative(root, res[0]);
|
||||
logger.info(`key: `, key);
|
||||
};
|
||||
|
||||
globFiles('./build/**/*');
|
||||
Reference in New Issue
Block a user