@@ -64,7 +64,7 @@ async function run () {
64
64
const isStale = lastRun . getTime ( ) + DAY < Date . now ( )
65
65
66
66
if ( typeof argv . api !== 'string' ) {
67
- spinner . fail ( 'You must specify the api, for example: \'make validate api=index type=request stack-version=8.1.0-SNAPSHOT \'' )
67
+ spinner . fail ( 'You must specify the api, for example: \'make validate api=index type=request branch=main \'' )
68
68
process . exit ( 1 )
69
69
}
70
70
@@ -75,15 +75,16 @@ async function run () {
75
75
76
76
// if true it's because the make target wasn't configured with a type argument
77
77
if ( argv . type !== true && argv . type !== 'request' && argv . type !== 'response' ) {
78
- spinner . fail ( 'You must specify the type (request or response), for example: \'make validate api=index type=request stack-version=8.1.0-SNAPSHOT \'' )
78
+ spinner . fail ( 'You must specify the type (request or response), for example: \'make validate api=index type=request branch=main \'' )
79
79
process . exit ( 1 )
80
80
}
81
81
82
- if ( typeof argv [ 'stack-version' ] !== 'string ' ) {
83
- spinner . fail ( 'You must specify the stack version , for example: \'make validate api=index type=request stack-version=8.1.0-SNAPSHOT \'' )
82
+ if ( typeof argv . branch !== 'string' && typeof argv . branch !== 'number ' ) {
83
+ spinner . fail ( 'You must specify the branch , for example: \'make validate api=index type=request branch=main \'' )
84
84
process . exit ( 1 )
85
85
}
86
86
87
+
87
88
const isFlightRecorderCloned = await $ `[[ -d ${ path . join ( __dirname , '..' , '..' , 'clients-flight-recorder' ) } ]]` . exitCode === 0
88
89
if ( ! isFlightRecorderCloned ) {
89
90
spinner . text = 'It looks like you didn\'t cloned the flight recorder, doing that for you'
@@ -165,7 +166,8 @@ async function run () {
165
166
166
167
spinner . text = 'Running validations'
167
168
168
- const branchName = argv [ 'stack-version' ] . startsWith ( '7.' ) ? '7.x' : argv [ 'stack-version' ] . slice ( 0 , 3 )
169
+ const branchArg = argv . branch . toString ( )
170
+ const branchName = branchArg . startsWith ( '7.' ) ? '7.x' : branchArg
169
171
170
172
if ( noCache || isStale || metadata . branchName !== branchName ) {
171
173
metadata . lastRun = new Date ( )
@@ -175,7 +177,7 @@ async function run () {
175
177
await $ `node ${ path . join ( uploadRecordingsPath , 'download.js' ) } --branch ${ branchName } `
176
178
177
179
spinner . text = 'Fetching artifacts'
178
- await $ `node ${ path . join ( cloneEsPath , 'index.js' ) } --version ${ argv [ 'stack-version ' ] } `
180
+ await $ `node ${ path . join ( cloneEsPath , 'index.js' ) } --branch ${ argv [ 'branch ' ] } `
179
181
}
180
182
181
183
cd ( tsValidationPath )
@@ -188,7 +190,7 @@ async function run () {
188
190
} else {
189
191
flags . push ( `--${ argv . type } ` )
190
192
}
191
- const output = await $ `STACK_VERSION= ${ argv [ 'stack-version' ] } node ${ path . join ( tsValidationPath , 'index.js' ) } --api ${ argv . api } ${ flags } `
193
+ const output = await $ `node ${ path . join ( tsValidationPath , 'index.js' ) } --api ${ argv . api } --branch ${ branchName } ${ flags } `
192
194
193
195
cd ( path . join ( compilerPath , '..' ) )
194
196
if ( output . exitCode === 0 ) {
0 commit comments