[ https://issues.apache.org/jira/browse/CB-9119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14579099#comment-14579099 ]
ASF GitHub Bot commented on CB-9119: ------------------------------------ Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-android/pull/180#discussion_r32027163 --- Diff: bin/templates/cordova/lib/exec.js --- @@ -19,16 +19,42 @@ under the License. */ -var child_process = require('child_process'), - Q = require('q'); +var child_process = require('child_process'); +var Q = require('q'); + +// constants +var DEFAULT_MAX_BUFFER = 1024000; // Takes a command and optional current working directory. // Returns a promise that either resolves with the stdout, or // rejects with an error message and the stderr. -module.exports = function(cmd, opt_cwd) { +// +// WARNING: +// opt_cwd is an artifact of an old design, and must +// be removed in the future; the correct solution is +// to pass the options object the same way that +// child_process.exec expects +// +// NOTE: +// exec documented here - https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback +module.exports = function(cmd, opt_cwd, options) { + var d = Q.defer(); + + if (options === undefined) { + options = {}; + } + + // override cwd to preserve old opt_cwd behavior + options.cwd = opt_cwd; + + // set maxBuffer + if (options.maxBuffer === undefined) { --- End diff -- Comparing to undefined is a bad practice: http://stackoverflow.com/questions/27509/detecting-an-undefined-object-property > ADB install in automation sometimes hangs the emulator > ------------------------------------------------------ > > Key: CB-9119 > URL: https://issues.apache.org/jira/browse/CB-9119 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: Master > Reporter: Dmitry Blotsky > Assignee: Dmitry Blotsky > Priority: Critical > Labels: adb, android, hang, hard_to_verify > Original Estimate: 72h > Remaining Estimate: 72h > > Sometimes "adb install ..." hangs indefinitely when running "cordova run" > under medic. Jenkins also sees this. Related links below. > Android bug: http://code.google.com/p/android/issues/detail?id=10255 -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org