Github user purplecabbage commented on a diff in the pull request:
https://github.com/apache/cordova-paramedic/pull/4#discussion_r59791877
--- Diff: lib/ParamedicKill.js ---
@@ -0,0 +1,95 @@
+#!/usr/bin/env node
+
+"use strict";
+
+var shelljs = require("shelljs");
+var util = require("./utils").utilities;
+var logger = require('./utils').logger;
+
+function ParamedicKill(platform) {
+ this.platform = platform;
+}
+
+ParamedicKill.prototype.kill = function() {
+ // shell config
+ shelljs.config.fatal = false;
+ shelljs.config.silent = false;
+
+ // get platform tasks
+ var platformTasks = this.tasksOnPlatform(this.platform);
+
+ if (platformTasks.length < 1) {
+ console.warn("no known tasks to kill");
+ }
+
+ // kill them
+ this.killTasks(platformTasks);
+
+ if (this.platform === util.ANDROID) {
+ this.killAdbServer();
+ }
+
+}
+
+ParamedicKill.prototype.tasksOnPlatform = function (platformName) {
+ switch (platformName) {
+ case util.WINDOWS:
+ return ["WWAHost.exe", "Xde.exe"];
+ case util.IOS:
+ return ["Simulator"];
+ case util.ANDROID:
+ if (util.isWindows()) {
+ return ["emulator-arm.exe"];
+ } else {
+ return ["emulator64-x86", "emulator64-arm"];
+ }
+ break;
--- End diff --
Personally I prefer NOT returning from a switch, and having a break for
every condition ( or a commented fall through )
```
var retTaskList = [];
switch(platformName) {
case util.WINDOWS :
retTaskList = ["WWAHost.exe", "Xde.exe"];
break;
...
}
return retTaskList;
```
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]