Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 6c26daa

Browse files
committed
fix(clean-up.ts): checked before writing to the file
1 parent 3a3a324 commit 6c26daa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/src/clean-up.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ export const cleanUp = async () => {
2323
const globalFilePath = join(stylesDir, 'typedcssx-global.css');
2424

2525
try {
26-
writeFileSync(styleFilePath, '/*------------------------------*/', 'utf-8');
26+
writeFileSync(styleFilePath, '/*______________________________*/', 'utf-8');
2727
console.log('...💫(reseted module css)');
28-
29-
writeFileSync(globalFilePath, '/*------------------------------*/', 'utf-8');
28+
if (existsSync(stylesDir)) {
29+
writeFileSync(globalFilePath, '/*______________________________*/', 'utf-8');
30+
}
3031
console.log('...💫(reseted global css)');
3132
} catch (err) {
3233
console.error('An error occurred:', err);

0 commit comments

Comments
 (0)