asar icon indicating copy to clipboard operation
asar copied to clipboard

--ordering not working on Windows (forward vs. backward slashes)

Open romaincointepas opened this issue 8 years ago • 2 comments

glob always returns results with forward-slashes (/), even on Windows (see this issue).

However, when parsing the Windows-generated hint file passed to --ordering, all paths have backward-slashes (\), meaning there will never be any matches, always resulting in 0% coverage.

cc @bengotow, original PR #52

romaincointepas avatar Feb 13 '17 15:02 romaincointepas

A temporary fix could be to do something like this:

if (path.sep === '\\') {
  str = str.replace(/\\/g, '/')
}
ordering.push(str)

at https://github.com/electron/asar/blob/master/lib/asar.js#L78.

Tested and it does the job, I wouldn't mind creating the PR if you're good with that @bengotow.

romaincointepas avatar Feb 13 '17 15:02 romaincointepas

Does this problem still exist on Windows platform ?

bruceauyeung avatar Nov 18 '21 07:11 bruceauyeung