2018-07-23 12:30:58 +00:00
|
|
|
const repl = require("repl");
|
|
|
|
|
|
|
|
class REPL {
|
|
|
|
constructor(options) {
|
|
|
|
this.env = options.env;
|
|
|
|
}
|
|
|
|
|
|
|
|
start(done) {
|
2018-07-23 16:05:01 +00:00
|
|
|
this.replServer = repl.start({
|
2018-07-24 08:40:48 +00:00
|
|
|
prompt: "Embark (" + this.env + ") > ",
|
|
|
|
useGlobal: true
|
2018-07-23 12:30:58 +00:00
|
|
|
});
|
|
|
|
|
2018-07-23 16:05:01 +00:00
|
|
|
this.replServer.on("exit", () => {
|
2018-07-23 12:41:13 +00:00
|
|
|
process.exit();
|
|
|
|
});
|
|
|
|
|
2018-07-23 12:30:58 +00:00
|
|
|
done();
|
|
|
|
}
|
2018-07-23 16:05:01 +00:00
|
|
|
|
2018-07-23 12:30:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = REPL;
|