forked from microsoft/azure-devops-node-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.ts
41 lines (29 loc) · 924 Bytes
/
run.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// do first just to ensure variables set
// export API_URL=https://buildcanary.visualstudio.com/DefaultCollection
// export export API_TOKEN=<yourAllScopesApiToken>
// export API_PROJECT=test
import * as cm from './common';
let samples: string[] = require('./samples.json');
let selection: string = process.argv[2];
if (selection) {
if (samples.indexOf(selection) == -1) {
console.error('Not a valid sample. See list of samples');
process.exit(1);
}
samples = [selection];
}
async function runSamples(selected?: string) {
for (let i: number = 0; i < samples.length; i++) {
let sample: string = samples[i];
if (selected && sample !== selected) {
continue;
}
cm.banner('Sample ' + sample);
var sm = require('./' + sample + '.js');
await sm.run();
}
}
function run() {
runSamples();
}
runSamples(process.argv[2]);