pty.js => node-pty

This commit is contained in:
Matheus Fernandes 2017-01-15 13:22:07 -02:00
parent 62c0f80493
commit 3cb09e0480
No known key found for this signature in database
GPG key ID: DD07CA4EA7B65C4F

View file

@ -8,13 +8,13 @@ const {getDecoratedEnv} = require('./plugins');
const {productName, version} = require('./package'); const {productName, version} = require('./package');
const config = require('./config'); const config = require('./config');
const createPtyJsError = () => new Error('`node-pty` failed to load. Typically this means that it was built incorrectly. Please check the `README.me` to more info.'); const createNodePtyError = () => new Error('`node-pty` failed to load. Typically this means that it was built incorrectly. Please check the `README.me` to more info.');
let spawn; let spawn;
try { try {
spawn = require('node-pty').spawn; spawn = require('node-pty').spawn;
} catch (err) { } catch (err) {
throw createPtyJsError(); throw createNodePtyError();
} }
const envFromConfig = config.getConfig().env || {}; const envFromConfig = config.getConfig().env || {};
@ -43,7 +43,7 @@ module.exports = class Session extends EventEmitter {
}); });
} catch (err) { } catch (err) {
if (/is not a function/.test(err.message)) { if (/is not a function/.test(err.message)) {
throw createPtyJsError(); throw createNodePtyError();
} else { } else {
throw err; throw err;
} }