Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-24912] Android: Running a module after it was built fails on Windows. #9184

Merged
merged 6 commits into from
Jul 6, 2017
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions android/cli/commands/_buildModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -1803,11 +1803,11 @@ AndroidModuleBuilder.prototype.runModule = function (next) {
}
}

function runTiCommand(cmd, args, logger, callback) {
// when calling a Windows batch file, we need to escape ampersands in the command
if (process.platform == 'win32' && /\.bat$/.test(cmd)) {
args.unshift('/S', '/C', cmd.replace(/\&/g, '^&'));
cmd = 'cmd.exe';
function runTiCommand(cmd, args, logger, callback) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to knit pick, but you have trailing whitespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have totally missed that.


// when calling on Windows, we need to escape ampersands in the command
if (process.platform == 'win32') {
cmd.replace(/\&/g, '^&');
}

var child = spawn(cmd, args);
Expand Down Expand Up @@ -1845,8 +1845,9 @@ AndroidModuleBuilder.prototype.runModule = function (next) {
this.logger.debug(__('Staging module project at %s', tmpDir.cyan));

runTiCommand(
'ti',
process.execPath,
[
process.argv[1],
'create',
'--id', this.manifest.moduleid,
'-n', this.manifest.name,
Expand Down Expand Up @@ -1893,8 +1894,9 @@ AndroidModuleBuilder.prototype.runModule = function (next) {
this.logger.debug(__('Running example project...', tmpDir.cyan));

runTiCommand(
'ti',
process.execPath,
[
process.argv[1],
'build',
'-p', 'android',
'-d', tmpProjectDir
Expand Down