Skip to content

Commit

Permalink
fix: checking for file existence before unlinking (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
rozsazoltan authored Feb 23, 2024
1 parent 3f3962e commit fb79248
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export default function i18n(options: string | VitePluginOptionsInterface = 'lan
let exitHandlersBound: boolean = false

const clean = () => {
files.forEach((file) => unlinkSync(langPath + file.name))
files.forEach((file) => {
const filePath = langPath + file.name
if (existsSync(filePath)) {
unlinkSync(filePath)
}
})

files = []

Expand Down

0 comments on commit fb79248

Please sign in to comment.