node-rcedit
node-rcedit copied to clipboard
fix: Wrong executable path on WSL
The path of executable file to be modified is not parsed properly on WSL, without normalizePath, it will try to modify the path inside WSL, which is not recognized properly, this PR fixed the problem.
Unable to load file: "/tmp/electron-packager/win32-x64/zheng-desktop-template-win32-x64/zheng-desktop-template.exe"
at ChildProcess.<anonymous> (/mnt/d/dev/zheng-desktop-template/node_modules/cross-spawn-windows-exe/node_modules/@malept/cross-spawn-promise/src/index.ts:172:16)
at ChildProcess.emit (events.js:375:28)
at ChildProcess.emit (domain.js:470:12)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) {
cmd: '/mnt/d/dev/zheng-desktop-template/node_modules/rcedit/bin/rcedit-x64.exe',
args: [
'/tmp/electron-packager/win32-x64/zheng-desktop-template-win32-x64/zheng-desktop-template.exe',
'--set-version-string',
'FileDescription',
'zheng-desktop-template',
'--set-version-string',
'InternalName',
'zheng-desktop-template',
'--set-version-string',
'OriginalFilename',
'zheng-desktop-template.exe',
'--set-version-string',
'ProductName',
'zheng-desktop-template',
'--set-version-string',
'CompanyName',
'Losses Don',
'--set-file-version',
'1.0.0',
'--set-product-version',
'1.0.0'
],
stdout: '',
stderr: 'Unable to load file: "/tmp/electron-packager/win32-x64/zheng-desktop-template-win32-x64/zheng-desktop-template.exe"\r\n',
code: 1
}
Electron Forge was terminated. Location:
{}
Please notice the first argument:
'/tmp/electron-packager/win32-x64/zheng-desktop-template-win32-x64/zheng-desktop-template.exe',
This is incorrect ;)
Can you please add a test for this so we don't regress (again)?
Can you please add a test for this so we don't regress (again)?
@malept I'd like to, but it confused me a lot, that how to mock a WSL environment, and how to know wslpath is called in other operating system?
Is this acceptable if this test can only be run in WSL?
Seems like you'd have to mock out both the is-wsl module and the call to cross-spawn-windows-exe's spawn of wslpath. I don't think CircleCI supports testing in WSL.
Also it seems that there is no CI being run for this PR :disappointed:
Also it seems that there is no CI being run for this PR 😞
Yeah... It seems that such case is not testable...
Also it seems that there is no CI being run for this PR disappointed
Yeah... It seems that such case is not testable...
I fixed CI if you push another commit with the mocks I suggested.
:tada: This PR is included in version 4.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket: