Fix up promise chaining for harness-push quit command

Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/7cf88fe2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/7cf88fe2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/7cf88fe2

Branch: refs/heads/master
Commit: 7cf88fe2cbe049d4aece3a0e6212b7ff40e4674b
Parents: d238bed
Author: Andrew Grieve <[email protected]>
Authored: Wed Jun 25 09:51:01 2014 -0400
Committer: Andrew Grieve <[email protected]>
Committed: Wed Jun 25 09:52:34 2014 -0400

----------------------------------------------------------------------
 harness-push/harness-push.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7cf88fe2/harness-push/harness-push.js
----------------------------------------------------------------------
diff --git a/harness-push/harness-push.js b/harness-push/harness-push.js
index c30247c..761a9d4 100755
--- a/harness-push/harness-push.js
+++ b/harness-push/harness-push.js
@@ -71,9 +71,12 @@ function main() {
             usage();
         }
         var pushSession = client.createPushSession(args.argv.remain[1]);
-        client.quit().then(pushSession.push().then(onSuccess, onFailure));
+        client.quit()
+        .then(function() {
+            return pushSession.push();
+        }).then(onSuccess, onFailure);
     } else if (cmd == 'deleteall') {
-        client.deleteAllApps();
+        client.deleteAllApps().then(onSuccess, onFailure);
     } else if (cmd == 'delete') {
         if (!args.argv.remain[1]) {
             usage();
@@ -93,7 +96,7 @@ function main() {
     } else if (cmd == 'launch') {
         client.launch(args.argv.remain[1]).then(onSuccess, onFailure);
     } else if (cmd == 'quit') {
-        client.quit(args.argv.remain[1]).then(onSuccess, onFailure);
+        client.quit().then(onSuccess, onFailure);
     } else {
         usage();
     }

Reply via email to