Skip to content

Commit

Permalink
fix: add forgotten decodeURIComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
destyk authored and dziraf committed Jul 1, 2024
1 parent 838ebd4 commit 3b4bca2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/file-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export const relativeFilePathResolver = (filePath: string, syntax: RegExp): stri
* Before: \D:\%D0%9D%D0%B8%D0%BA%D0%B8%D1%82%D0%B0\project\dist\components\photo
* After: \D:\Никита\project\dist\components\photo
*/
const resultPath = path.join(path.dirname(executionPath), filePath).replace(/^file:/gi, '')
const resultPath = decodeURIComponent(path.join(path.dirname(executionPath), filePath).replace(/^file:/gi, ''))

/**
* If the separator is a backslash, remove the first one.
* If you do not do this, the file will not be found
*
*
* Required for Windows
*/
if (path.sep === '\\' && resultPath[0] === '\\') {
return resultPath.slice(1)
}

return resultPath
}

0 comments on commit 3b4bca2

Please sign in to comment.