Skip to content

Commit

Permalink
fix: remove previously created symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
dziudek committed Mar 6, 2024
1 parent d9600c2 commit 96482ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/back-end/modules/render-html/helpers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ class Files {
dirs.push('posts/' + postIDs[i]);
}

try {
if (fs.existsSync(basePathOutput)) {
const stats = fs.lstatSync(basePathOutput);

if (stats.isSymbolicLink()) {
fs.unlinkSync(basePathOutput);
}
}
} catch (err) {
console.log('[Error] Symlink removal problem: ' + err);
}

if (!UtilsHelper.dirExists(path.join(basePathOutput))) {
fs.mkdirSync(path.join(basePathOutput));
}
Expand Down

0 comments on commit 96482ed

Please sign in to comment.