Skip to content

Commit

Permalink
fix: Windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
3N26 committed Jul 20, 2020
1 parent c983609 commit f670143
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/img.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function getImgUrl(ctx, baseClass, opt) {
const root = ctx.rootContext || process.cwd();
const subImgPath = baseClass.split(opt.prefix)[1].replace(/_/g, '/');
const imgPath = path.join(opt.imgDir, subImgPath);
const absolutePath = path.join(root, imgPath)
const relativePath = path.relative(file, absolutePath).slice(1);
const absolutePath = path.join(root, imgPath).replace(/\\/g, '/');
const relativePath = path.relative(file, absolutePath).slice(1).replace(/\\/g, '/');
const type = getImgType(imgPath, opt)
return [type, imgPath + type, relativePath + type];
}
Expand Down

0 comments on commit f670143

Please sign in to comment.