1- import * as cm from ' ./common' ;
2- import * as vm from ' azure-devops-node-api' ;
1+ import * as cm from " ./common" ;
2+ import * as vm from " azure-devops-node-api" ;
33
4- import * as ba from ' azure-devops-node-api/BuildApi' ;
5- import * as bi from ' azure-devops-node-api/interfaces/BuildInterfaces' ;
4+ import * as ba from " azure-devops-node-api/BuildApi" ;
5+ import * as bi from " azure-devops-node-api/interfaces/BuildInterfaces" ;
66
77export async function run ( ) {
88 try
99 {
1010 let vsts : vm . WebApi = await cm . getWebApi ( ) ;
1111 let vstsBuild : ba . IBuildApi = await vsts . getBuildApi ( ) ;
1212
13- cm . banner ( ' Build Samples' ) ;
13+ cm . banner ( " Build Samples" ) ;
1414 let project = cm . getProject ( ) ;
15- console . log ( ' project' , project ) ;
15+ console . log ( " project" , project ) ;
1616
1717 // list definitions
18- cm . heading ( ' Build Definitions for ' + project ) ;
18+ cm . heading ( ` Build Definitions for ${ project } ` ) ;
1919 let defs : bi . DefinitionReference [ ] = await vstsBuild . getDefinitions ( project ) ;
2020
21- console . log ( ' You have ' + defs . length + ' build definition(s)' ) ;
21+ console . log ( ` You have ${ defs . length } build definition(s)` ) ;
2222
2323 // save off last def to create a new definition below
2424 let lastDef : bi . BuildDefinition ;
@@ -29,11 +29,11 @@ export async function run() {
2929 lastDef = def ;
3030 let rep : bi . BuildRepository = def . repository ;
3131
32- console . log ( defRef . name + ' (' + defRef . id + ') ' + ' repo ' + rep . type ) ;
32+ console . log ( ` ${ defRef . name } ( ${ defRef . id } ) repo ${ rep . type } ` ) ;
3333 }
3434
3535 // get top 10 successfully completed builds since 2016
36- cm . heading ( ' top 10 successfully completed builds for ' + project + ' project' ) ;
36+ cm . heading ( ` top 10 successfully completed builds for ${ project } project` ) ;
3737 let builds : bi . Build [ ] = await vstsBuild . getBuilds (
3838 project ,
3939 null , // definitions: number[]
@@ -51,20 +51,20 @@ export async function run() {
5151 10 // top: number
5252 ) ;
5353
54- console . log ( builds . length + ' builds returned' ) ;
54+ console . log ( ` ${ builds . length } builds returned` ) ;
5555 builds . forEach ( ( build : bi . Build ) => {
56- console . log ( build . buildNumber , bi . BuildResult [ build . result ] , 'on' , build . finishTime . toDateString ( ) ) ;
56+ console . log ( build . buildNumber , bi . BuildResult [ build . result ] , "on" , build . finishTime . toDateString ( ) ) ;
5757 } ) ;
5858
5959 // new definition
6060 if ( lastDef && lastDef . process && lastDef . process . type === 1 /* Designer */ ) {
6161 let process = lastDef . process as bi . DesignerProcess ;
6262 if ( process . phases && process . phases . length > 0 ) {
6363 let phase = process . phases [ 0 ] ;
64- cm . heading ( ' creating a new definition' ) ;
64+ cm . heading ( " creating a new definition" ) ;
6565 let newDef : bi . BuildDefinition = < bi . BuildDefinition > { } ;
6666
67- let newName : string = " api copy of " + lastDef . name ;
67+ let newName = ` api copy of ${ lastDef . name } ` ;
6868 console . log ( "name" , newName ) ;
6969 newDef . name = newName ;
7070
@@ -137,7 +137,7 @@ export async function run() {
137137 }
138138 }
139139 catch ( err ) {
140- console . error ( ' Error: ' + err . stack ) ;
140+ console . error ( ` Error: ${ err . stack } ` ) ;
141141 }
142142
143143}
0 commit comments