mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 09:46:37 +00:00
Adding profile command
This commit is contained in:
parent
7a34b9d675
commit
2f6e96db86
@ -3,6 +3,7 @@ const repl = require("repl");
|
|||||||
class REPL {
|
class REPL {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.env = options.env;
|
this.env = options.env;
|
||||||
|
this.plugins = options.plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
start(done) {
|
start(done) {
|
||||||
@ -15,6 +16,19 @@ class REPL {
|
|||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let self = this;
|
||||||
|
this.replServer.defineCommand('profile', {
|
||||||
|
help: 'Profile a contract',
|
||||||
|
action(contract) {
|
||||||
|
this.clearBufferedCommand();
|
||||||
|
let pluginCmds = self.plugins.getPluginsProperty('console', 'console');
|
||||||
|
for (let pluginCmd of pluginCmds) {
|
||||||
|
pluginCmd.call(self, `profile ${contract}`, {});
|
||||||
|
}
|
||||||
|
this.displayPrompt();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ class Embark {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function startREPL(callback) {
|
function startREPL(callback) {
|
||||||
let repl = new REPL({env: engine.env});
|
let repl = new REPL({env: engine.env, plugins: engine.plugins});
|
||||||
repl.start(callback);
|
repl.start(callback);
|
||||||
}
|
}
|
||||||
], function (err, _result) {
|
], function (err, _result) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user