Skip to content

Fix cache on 'make validate' #4005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions compiler/run-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ try {
closest = fl.closest
minimist = require('minimist')
} catch (err) {
console.log('It looks like you didn\'t install the project dependencies, please run \'make setup\'')
console.log(
"It looks like you didn't install the project dependencies, please run 'make setup'"
)
process.exit(1)
}

Expand Down Expand Up @@ -60,7 +62,8 @@ const apis = require('../output/schema/schema.json')
async function run () {
const options = minimist(process.argv.slice(2), {
string: ['api', 'type', 'branch'],
boolean: ['cache']
boolean: ['cache'],
default: { cache: true }
})

spinner.text = 'Checking requirements'
Expand Down Expand Up @@ -93,7 +96,7 @@ async function run () {

const isFlightRecorderCloned = await $`[[ -d ${path.join(__dirname, '..', '..', 'clients-flight-recorder')} ]]`.exitCode === 0
if (!isFlightRecorderCloned) {
spinner.text = 'It looks like you didn\'t cloned the flight recorder, doing that for you'
spinner.text = 'It looks like you didn\'t clone the flight recorder, doing that for you'
await $`git clone https://github.com/elastic/clients-flight-recorder.git ${path.join(__dirname, '..', '..', 'clients-flight-recorder')}`
} else if (isStale) {
spinner.text = 'Pulling the latest flight recorder changes'
Expand All @@ -105,7 +108,7 @@ async function run () {
const isCompilerInstalled = await $`[[ -d ${path.join(compilerPath, 'node_modules')} ]]`.exitCode === 0
const isTsGeneratorInstalled = await $`[[ -d ${path.join(tsGeneratorPath, 'node_modules')} ]]`.exitCode === 0
if (noCache || !isCompilerInstalled || !isTsGeneratorInstalled) {
spinner.text = 'It looks like you didn\'t installed the project dependencies, doing that for you'
spinner.text = 'It looks like you didn't install the project dependencies, doing that for you'
await $`npm install --prefix ${compilerPath}`
await $`npm install --prefix ${tsGeneratorPath}`
}
Expand Down