Skip to content

Commit

Permalink
fix: use POSIX path whenever posible
Browse files Browse the repository at this point in the history
  • Loading branch information
ooker777 committed Jul 11, 2024
1 parent 6df50d7 commit 88cdbc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const copyAssetsAndWriteFile = async (sourceDir, file, targetDir) => {
for (let image of allImages) {
const [, imgPath] = image;
if (!isAbsoluteURL(imgPath)) {
const relPath = decodeURIComponent(path.join(path.dirname(file), imgPath));
const relPath = decodeURIComponent(path.join(path.dirname(file), imgPath.replaceAll('\\', '/')));
const sourceImgPath = path.join(sourceDir, relPath);
const targetImgPath = path.join(targetDir, relPath);
awaits.push(cp(sourceImgPath, targetImgPath).catch(err => console.warn(err)));
Expand Down

0 comments on commit 88cdbc0

Please sign in to comment.