Skip to content

Commit

Permalink
maksimrv M bin/bb
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimr committed Jul 31, 2016
1 parent 25a7c99 commit 3120ffc
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bin/bb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function printHelp() {
}

function printLine(option, description) {
console.log(' ' + option + ' ' + description);
console.log(' ' + option + ' ' + description);
}
}

Expand All @@ -85,17 +85,20 @@ function ls(options) {
const buildTypeId = getBuildTypeId();

if (options.remote) {
httpGET('/guestAuth/app/rest/buildTypes/' + buildTypeId + '/builds?locator=status:SUCCESS&count=' + count, (response) => {
response.build.forEach((build) => {
console.log(build.number);
listLocalBuilds((installedBuilds) => {
httpGET('/guestAuth/app/rest/buildTypes/' + buildTypeId + '/builds?locator=status:SUCCESS&count=' + count, (response) => {
response.build.forEach((build) => {
var isInstalled = installedBuilds.indexOf(build.number) > -1;
printBuild(build.number, isInstalled);
});
});
});
return;
}

listLocalBuilds((files) => {
files.forEach((buildNumber) => {
console.log(buildNumber);
printBuild(buildNumber, true);
});
});
}
Expand Down Expand Up @@ -675,3 +678,8 @@ function createWriteStream(filePath) {

return file;
}

function printBuild(buildNumber, isInstalled) {
var marker = isInstalled ? '◉' : '◯';
console.log(' ' + marker + ' ' + buildNumber);
}

0 comments on commit 3120ffc

Please sign in to comment.