Skip to content

Commit

Permalink
Don't run mill --version on pre script
Browse files Browse the repository at this point in the history
We may not have a JVM ready yet
  • Loading branch information
alejandrohdezma committed Jan 9, 2023
1 parent dca78a4 commit c39e321
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/modules/mill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,7 @@ export async function install(): Promise<void> {
await tc.cacheFile(mill, 'mill', 'mill', millVersion)
}

let output = ''

const code = await exec.exec('mill', ['--version'], {
silent: true,
ignoreReturnCode: true,
listeners: {
stdout(data) {
(output += data.toString())
}, errline: core.debug,
},
})

if (code !== 0) {
throw new Error('Unable to install Mill')
}

const version = output.split('\n')[0].replace(/^Mill Build Tool version /, '').trim()

core.info(`✓ Mill installed, version: ${version}`)
core.info(`✓ Mill installed, version: ${millVersion}`)
} catch (error: unknown) {
core.error((error as Error).message)
throw new Error('Unable to install Mill')
Expand Down

0 comments on commit c39e321

Please sign in to comment.