Skip to content

Commit b4dcca0

Browse files
main.ts run -> check template
1 parent aa5a814 commit b4dcca0

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/main.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,21 @@ console.table({
1919
APIS: config.exportPath,
2020
});
2121

22-
console.log('');
23-
if (argumentsInstance.clean) {
24-
console.log('Removing previously generated data...');
25-
fs.removeSync(config.exportPath);
26-
} else {
27-
console.log('no-clean flag recevived, clean folder skipped');
28-
}
29-
console.log('');
30-
3122
// Read the file
3223
async function run() {
3324
try {
25+
// Check if the template does not exist
26+
config.templatePath;
27+
28+
console.log('');
29+
if (argumentsInstance.clean) {
30+
console.log('Removing previously generated data...');
31+
fs.removeSync(config.exportPath);
32+
} else {
33+
console.log('no-clean flag recevived, clean folder skipped');
34+
}
35+
console.log('');
36+
3437
console.log('Opening file:', argumentsInstance.file);
3538
const fileParser = new FileReaderService(argumentsInstance.file, config);
3639
console.log('Parsing file...');

0 commit comments

Comments
 (0)