Skip to content

Commit 341649b

Browse files
committed
feat: optimize skipping the unwanted transform file prompt
1 parent c9d2dba commit 341649b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/setup.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import writeFile from "./writeFile";
77
const CONFIG_FILE_NAME = "tosetup.config" as const;
88

99
async function setup() {
10-
output.log("tosetup begin...\n");
10+
const start = Date.now();
1111
const argv = process.argv.slice(2).filter(Boolean);
1212

1313
let { pathNames, commands } = argv.reduce<{
@@ -66,11 +66,10 @@ async function setup() {
6666
output.error(`write ${path} failure.\n`);
6767
console.log(error);
6868
}
69-
} else {
70-
output.error(`File ${path} transform failure.\n`);
7169
}
7270
}
73-
output.log("\ntosetup end.");
71+
72+
output.log(`Done in ${Math.floor(Date.now() - start)}ms.`);
7473
}
7574

7675
setup();

src/transform/sfc.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export function transformSfc(path: string, option: CommandsOption) {
1212
} = parse(sfc);
1313

1414
if (scriptSetup || !script) {
15+
output.log(`skip ${path}`);
1516
return null;
1617
}
1718

@@ -38,6 +39,7 @@ export function transformSfc(path: string, option: CommandsOption) {
3839

3940
return ms.toString();
4041
} else {
42+
output.error(`File ${path} transform failure.\n`);
4143
return null;
4244
}
4345
}

0 commit comments

Comments
 (0)