Simplify readline setup for Windows users
This commit is contained in:
parent
19929842a2
commit
31bfa85fa8
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
var Cylon, readLine,
|
var Cylon,
|
||||||
__slice = [].slice,
|
__slice = [].slice,
|
||||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||||
|
|
||||||
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
require('./api');
|
require('./api');
|
||||||
|
|
||||||
readLine = require("readline");
|
|
||||||
|
|
||||||
Logger.setup();
|
Logger.setup();
|
||||||
|
|
||||||
Cylon = (function() {
|
Cylon = (function() {
|
||||||
|
@ -54,9 +52,10 @@
|
||||||
|
|
||||||
function Master() {
|
function Master() {
|
||||||
this.robot = __bind(this.robot, this);
|
this.robot = __bind(this.robot, this);
|
||||||
var rl;
|
var readLine, rl;
|
||||||
this.self = this;
|
this.self = this;
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
|
readLine = require("readline");
|
||||||
rl = readLine.createInterface({
|
rl = readLine.createInterface({
|
||||||
input: process.stdin,
|
input: process.stdin,
|
||||||
output: process.stdout
|
output: process.stdout
|
||||||
|
|
|
@ -12,8 +12,6 @@ require('./utils')
|
||||||
require('./logger')
|
require('./logger')
|
||||||
require('./api')
|
require('./api')
|
||||||
|
|
||||||
readLine = require "readline"
|
|
||||||
|
|
||||||
Logger.setup()
|
Logger.setup()
|
||||||
|
|
||||||
# Cylon is the global namespace for the project, and also in charge of
|
# Cylon is the global namespace for the project, and also in charge of
|
||||||
|
@ -41,6 +39,7 @@ class Cylon
|
||||||
constructor: ->
|
constructor: ->
|
||||||
@self = this
|
@self = this
|
||||||
if process.platform is "win32"
|
if process.platform is "win32"
|
||||||
|
readLine = require "readline"
|
||||||
rl = readLine.createInterface
|
rl = readLine.createInterface
|
||||||
input: process.stdin
|
input: process.stdin
|
||||||
output: process.stdout
|
output: process.stdout
|
||||||
|
|
Loading…
Reference in New Issue