Github user sgrebnov commented on a diff in the pull request:
https://github.com/apache/cordova-cli/pull/161#discussion_r11533344
--- Diff: src/superspawn.js ---
@@ -24,6 +24,8 @@ var _ = require('underscore');
var Q = require('q');
var shell = require('shelljs');
var events = require('./events');
+var iswin32 = process.platform == 'win32';
+var wrapcmd = iswin32 && require('os').release().split('.')[0] < 6;
--- End diff --
No, cli does not work; this patch is required (I think it is super
useful). Win8.1 x64.
I have the following hook file so cordova-cli is trying to run it during
build. The file is located at project with **whitespace** in the name.
c:\temp\sql2 app\hooks\before_build\cordova-plugin-websql3.bat
**cordova-cli from npm(3.4.1-0.1.0)**
c:\temp\sql2 app>cordova build -d
Running command: "c:\temp\sql2
app\hooks\before_build\cordova-plugin-websql3.bat" "c:\temp\sql2 app"
'c:\temp\sql2' is not recognized as an internal or external command,
operable program or batch file.
The error above is due to the following reason: cli shows command in output
as escaped, but actually it is not. So if I escape it, I receive the following
error - I believe this is because spawn can't run bat file directly.
c:\temp\sql2 app>cordova build -d
Running command: "c:\temp\sql2
app\hooks\before_build\cordova-plugin-websql3.bat" "c:\temp\sql2 app"
Command finished with error code ENOENT: c:\temp\sql2
app\hooks\before_build\cordova-plugin-websql3.bat c:\temp\sql2 app
Hook failed with error code ENOENT: c:\temp\sql2
app\hooks\before_build\cordova-
plugin-websql3.bat
**w/ path** - works the same since patch is not applied due to wrapcmd =
False (seee below)
c:\temp\sql2 app>cordova build -d
Running command: "c:\temp\sql2
app\hooks\before_build\cordova-plugin-websql3.bat" "c:\temp\sql2 app"
'c:\temp\sql2' is not recognized as an internal or external command,
operable program or batch file.
**w/ path and w/o check for require('os').release().split('.')[0] < 6**
(manually removed)
c:\temp\sql2 app>cordova build -d
Running command: cmd "/s /c ""c:\temp\sql2
app\hooks\before_build\cordova-plugin-websql3.bat" "c:\temp\sql2 app"""
"SUCCESS"
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---