Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Executor = {
- //this.program = "";
- //this.args = [];
- constructor(options) {
- this.program = options.program;
- console.log(options);
- console.log(this.Object.keys());
- for(var o in options) {
- if(this.Object.keys.indexOf(o) === -1) {
- this.args.push(options[o]);
- }
- }
- },
- successAction: function(data)
- {
- console.log(data);
- },
- errorAction: function(err) {
- console.log(err);
- },
- execute: function() {
- var command = this.program + ' ' + this.args.join(' ');
- console.log("Execution => " + command);
- exec(command, function(err, data) {
- if(err != null) {
- this.errorAction(err);
- } else {
- this.successAction(data);
- }
- });
- }
- //this.execute();
- }
Advertisement
Add Comment
Please, Sign In to add comment