Skip to content

Commit

Permalink
refactor(execute): Quitando la funcion validateOutput.
Browse files Browse the repository at this point in the history
  • Loading branch information
jansanchez committed Nov 3, 2014
1 parent be3b296 commit 6022532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
10 changes: 1 addition & 9 deletions dist/package/lib/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,9 @@ Execute.prototype.runCommand = function(command) {
var newCommand;
newCommand = command + " 2>&1 1>output && echo done > done";
execute(newCommand);
this.validateOutput(command);
return this.output;
};

Execute.prototype.validateOutput = function(command) {
this.readFile();
if (this.output === '') {
console.log('esto llega a pasar en algun momento?');
this.runCommand(command);
}
this.reset();
return this.output;
};

Execute.prototype.readFile = function() {
Expand Down
9 changes: 1 addition & 8 deletions source/coffee/package/lib/execute.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ Execute::runCommand = (command) ->
newCommand = command + " 2>&1 1>output && echo done > done"

execute(newCommand)
@validateOutput(command)
return @output

Execute::validateOutput = (command) ->
@readFile()
if @output is ''
console.log('esto llega a pasar en algun momento?')
@runCommand(command)
@reset()
return
return @output

Execute::readFile = () ->
flag = true
Expand Down

0 comments on commit 6022532

Please sign in to comment.