Skip to content

Instantly share code, notes, and snippets.

@arthurwolf
Created September 6, 2018 16:41
Show Gist options
  • Save arthurwolf/03baa542a06196e82dd3fa4031ed58f3 to your computer and use it in GitHub Desktop.
Save arthurwolf/03baa542a06196e82dd3fa4031ed58f3 to your computer and use it in GitHub Desktop.
HOW MAKE SHORTER ?
if( progress_answer.match(/est time/)){
var found = progress_answer.match(/file: (.+?), (\d+) % complete, elapsed time: (\d+):(\d+):(\d+), est time: (\d+):(\d+):(\d+)/);
that.status.file = found[1];
that.status.percent = found[2];
that.status.elapsed.set(found[3], found[4], found[5]);
this.status.estimated.set(found[6], found[7], found[8]);
}else{
var found = progress_answer.match(/file: (.+?), (\d+) % complete, elapsed time: (\d+):(\d+):(\d+)/);
that.status.file = found[1];
that.status.percent = found[2];
that.status.elapsed.set(found[3], found[4], found[5]);
this.status.estimated.set('00', '00', '00');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment