-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.ts
More file actions
25 lines (21 loc) · 808 Bytes
/
test.ts
File metadata and controls
25 lines (21 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import avx from './src/avx';
import chalk from 'chalk';
avx(['.config', 'xml'], ['README.md'], ['c'], 'sample_folder').then(result => {
const succeed = result.filter(i => i?.formatted);
const failed = result.filter(i => i?.err);
if (succeed?.length > 0) {
console.info(`[${chalk.greenBright.bgYellowBright.bold('Succeed')}]`);
succeed.forEach(v => {
console.info(chalk.greenBright(`path: ${v.path}`));
});
}
if (succeed?.length > 0 && failed?.length > 0) {
console.log(`---------😀${chalk.gray.bold('Happy Delimiter')}😀---------`);
}
if (failed?.length > 0) {
console.error(`[${chalk.redBright.bgRedBright.bold('Failed')}]`);
failed.forEach(v => {
console.error(chalk.greenBright(`path: ${v.path} msg: ${v.err?.message}`));
});
}
}).catch(error => console.error(error));