-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Labels
Description
I believe this was caused by #121
A copy action like the following results in a forward slashed path for the copy
command, and the system complains it cannot find the file specified:
{
"target_name": "copy_binary",
"type":"none",
"dependencies" : [ "build_binary"],
'actions': [
{
'action_name': 'copy_binary',
'inputs': ['<(module_root_dir)/build/<(CONFIGURATION_NAME)/binary.exe'],
'outputs': ['<(module_root_dir)/../build_app/binary_$(PlatformShortName).exe'],
'action': ['SET COPYCMD=/Y && copy', '<@(_inputs)', '<@(_outputs)'],
}
]
}
In the vcproj we can see:
<CustomBuild Include="C:\Users\alexc\code\redacted\client\www\electron\native\build\$(ConfigurationName)\binary.exe">
<FileType>Document</FileType>
<Command>call call SET COPYCMD=\Y && copy "C:/Users/alexc/code/redacted/client/www/electron/native/build/$(Configuration)/binary.exe" "C:/Users/alexc/code/redacted/client/www/electron/build_app/binary_$(PlatformShortName).exe"
if %errorlevel% neq 0 exit /b %errorlevel%</Command>
<Message>copy_binary</Message>
<Outputs>C:\Users\alexc\code\redacted\client\www\electron\build_app\binary_$(PlatformShortName).exe</Outputs>
</CustomBuild>
To me, reading the comment here does not match the added code:
# If the argument starts with a slash or dash, it's probably a command line
# switch
# Return the path with forward slashes because the command using it might
# not support backslashes.
arguments = [i if (i[:1] in "/-") else _FixPath(i, "/") for i in cmd[1:]]
I believe it should be something like:
arguments = [_FixPath(i, "/") if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]]
OR don't call FixPath at all if it's not a command line switch and enforce backslashes be used directly in the inputs/outputs.