@@ -96,21 +96,23 @@ async function bump (args) {
96
96
97
97
// this command can only be executed locally for now
98
98
async function codegen ( args ) {
99
- assert ( args . length === 1 , 'Bump task expects one parameter' )
100
- const clientGeneratorPath = join ( import . meta. url , '..' , '..' , 'elastic-client-generator-js' )
99
+ assert ( args . length === 1 , 'Codegen task expects one parameter' )
101
100
const [ version ] = args
102
101
102
+ const clientGeneratorPath = join ( import . meta. url , '..' , '..' , 'elastic-client-generator-js' )
103
103
const isGeneratorCloned = await $ `[[ -d ${ clientGeneratorPath } ]]` . exitCode === 0
104
104
assert ( isGeneratorCloned , 'You must clone the elastic-client-generator-js first' )
105
105
106
106
await $ `npm install --prefix ${ clientGeneratorPath } `
107
- // this command will take a while!
107
+
108
+ // generate elasticsearch client. this command will take a while!
108
109
if ( version === 'main' ) {
109
110
await $ `npm run elasticsearch --prefix ${ clientGeneratorPath } -- --version main`
110
111
} else {
111
112
await $ `npm run elasticsearch --prefix ${ clientGeneratorPath } -- --version ${ version . split ( '.' ) . slice ( 0 , 2 ) . join ( '.' ) } `
112
113
}
113
- await $ `npm run lint --prefix ${ clientGeneratorPath } `
114
+ // clean up fixable linter issues
115
+ await $ `npm run fix --prefix ${ clientGeneratorPath } `
114
116
115
117
await $ `rm -rf ${ join ( import . meta. url , '..' , 'src' , 'api' ) } `
116
118
await $ `mkdir ${ join ( import . meta. url , '..' , 'src' , 'api' ) } `
0 commit comments