Skip to content

Commit 96482ed

Browse files
committed
fix: remove previously created symlinks
1 parent d9600c2 commit 96482ed

File tree

1 file changed

+12
-0
lines changed
  • app/back-end/modules/render-html/helpers

1 file changed

+12
-0
lines changed

app/back-end/modules/render-html/helpers/files.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ class Files {
177177
dirs.push('posts/' + postIDs[i]);
178178
}
179179

180+
try {
181+
if (fs.existsSync(basePathOutput)) {
182+
const stats = fs.lstatSync(basePathOutput);
183+
184+
if (stats.isSymbolicLink()) {
185+
fs.unlinkSync(basePathOutput);
186+
}
187+
}
188+
} catch (err) {
189+
console.log('[Error] Symlink removal problem: ' + err);
190+
}
191+
180192
if (!UtilsHelper.dirExists(path.join(basePathOutput))) {
181193
fs.mkdirSync(path.join(basePathOutput));
182194
}

0 commit comments

Comments
 (0)