Skip to content

Commit f414c12

Browse files
author
jfrux
committed
Fixes for WIndows
1 parent 75f3292 commit f414c12

File tree

4 files changed

+19
-38
lines changed

4 files changed

+19
-38
lines changed

app/sagas/network_scanner_sagas.js

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,7 @@ import * as networkConnectionTypes from '../constants/network_connection_action_
1111
import * as networkScannerActions from '../actions/network_scanner_actions';
1212
import * as eonListActions from '../actions/eon_list_actions';
1313
import ping from 'net-ping';
14-
function timer(secs) {
15-
return eventChannel(emitter => {
16-
const iv = setInterval(() => {
17-
secs -= 1;
18-
if (secs > 0) {
19-
emitter(secs);
20-
} else {
21-
// this causes the channel to close
22-
emitter(END);
23-
}
24-
}, 1000);
25-
// The subscriber must return an unsubscribe function
26-
return () => {
27-
clearInterval(iv);
28-
};
29-
}
30-
);
31-
}
14+
3215
function revisedRandId() {
3316
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10);
3417
}
@@ -172,18 +155,23 @@ function* resolveEon(action) {
172155
function pingEon(eon) {
173156
// console.warn("Pinging EON",eon);
174157
return new Promise((resolve,reject) => {
175-
var session = ping.createSession();
158+
try {
159+
var session = ping.createSession();
176160

177-
session.pingHost(eon.ip, function pingEon(error, target) {
178-
if (error) {
179-
console.warn("No response from EON",error.toString());
180-
reject(eon, "Could not ping EON...", error.toString());
181-
} else {
182-
resolve(true);
183-
// console.warn("Response found for EON",eon);
184-
session.close();
185-
}
186-
});
161+
session.pingHost(eon.ip, function pingEon(error, target) {
162+
if (error) {
163+
console.warn("No response from EON",error.toString());
164+
reject(eon, "Could not ping EON...", error.toString());
165+
} else {
166+
resolve(true);
167+
// console.warn("Response found for EON",eon);
168+
session.close();
169+
}
170+
});
171+
} catch (e) {
172+
console.warn("Cannot ping on this platform...");
173+
resolve(true);
174+
}
187175
});
188176
}
189177

@@ -210,7 +198,7 @@ function* pingEons() {
210198
const { foundCount } = networkScanner;
211199
const { eons, unresolvedEons } = eonList;
212200
let eonKeys = Object.keys(eons);
213-
rpc.emit('notify',{title: 'Workbench finished scanning!',body: `Found ${foundCount} EON on the network.`});
201+
// rpc.emit('notify',{title: 'Workbench finished scanning!',body: `Found ${foundCount} EON on the network.`});
214202
// console.warn("Pinging EONS:",eonKeys);
215203
yield all(eonKeys.map(function * (key) {
216204
const eon = eons[key];

app/utils/default-shell.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ export default (() => {
2020
const env = process.env;
2121
let userShell;
2222
let shell;
23-
2423
if (userConfig && userConfig.shell && (userConfig.shell+'').length > 0) {
2524
return userConfig.shell;
2625
} else {
2726
if (process.platform === 'darwin') {
2827
shell = userShell || env.SHELL || '/bin/bash';
2928
} else if (process.platform === 'win32') {
3029
// Tests commands on the operating system and sets the userConfig to use that shell.
31-
for (i = 0; i < windowsShells.length; i++) {
30+
for (let i = 0; i < windowsShells.length; i++) {
3231
const testShell = windowsShells[i];
3332

3433
if (shellExists(testShell)) {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@
266266
"node-cmd": "^3.0.0",
267267
"node-ssh": "^5.1.2",
268268
"popper.js": "^1.14.4",
269-
"raw-loader": "^0.5.1",
270269
"react": "^16.4.1",
271270
"react-chartkick": "^0.3.0",
272271
"react-dom": "^16.4.1",

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11770,11 +11770,6 @@ [email protected]:
1177011770
iconv-lite "0.4.23"
1177111771
unpipe "1.0.0"
1177211772

11773-
raw-loader@^0.5.1:
11774-
version "0.5.1"
11775-
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa"
11776-
integrity sha1-DD0L6u2KAclm2Xh793goElKpeao=
11777-
1177811773
raw-socket@*:
1177911774
version "1.6.4"
1178011775
resolved "https://registry.yarnpkg.com/raw-socket/-/raw-socket-1.6.4.tgz#adf3b0dbb6c2707386e6c13aca401240552067c1"

0 commit comments

Comments
 (0)