Skip to content

Instantly share code, notes, and snippets.

@raine
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raine/14c63c0848deaa3145e3 to your computer and use it in GitHub Desktop.
Save raine/14c63c0848deaa3145e3 to your computer and use it in GitHub Desktop.
// Generated by LiveScript 1.3.1
var cliTail;
cliTail = async(function*(jobName, buildNumber, follow){
var output;
output = yield tail(jobName, buildNumber, follow);
output.cata({
Just: function(output){
return output.pipe(formatTailOutput()).pipe(process.stdout).on('end', process.exit);
},
Nothing: function(){
var str;
str = "unable to find job";
return console.log((function(){
switch (false) {
case buildNumber == null:
return str + " or build: " + jobName + " [#" + buildNumber + "]";
default:
return str + ": " + jobName;
}
}()));
}
});
});
cli-tail = async (job-name, build-number, follow) ->*
output = yield tail job-name, build-number, follow
output.cata do
Just: (output) ->
output
.pipe format-tail-output!
.pipe process.stdout
.on \end process.exit
Nothing: ->
str = "unable to find job"
console.log switch
| build-number? => "#str or build: #job-name [##{build-number}]"
| otherwise => "#str: #job-name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment