add installScripts step in boostrap command

- Scripts have to be updated before running bootstrap core/install
This commit is contained in:
Yann Braga 2022-09-27 12:24:48 +02:00
parent 025487a4bf
commit dd56e5aae6

34
scripts/bootstrap.js vendored
View File

@ -3,6 +3,7 @@
/* eslint-disable global-require */
const { spawnSync } = require('child_process');
const path = require('path');
const { join } = require('path');
const { maxConcurrentTasks } = require('./utils/concurrency');
@ -113,6 +114,7 @@ function run() {
const command = process.env.CI ? `yarn install --immutable` : `yarn install`;
return spawn(command);
},
pre: ['installScripts'],
order: 1,
}),
build: createTask({
@ -147,6 +149,15 @@ function run() {
},
order: 9,
}),
installScripts: createTask({
name: `Install dependencies on scripts directory ${chalk.gray('(dev)')}`,
defaultValue: false,
option: '--installScripts',
command: () => {
return spawn('yarn install', { cwd: path.join('..', 'scripts') });
},
order: 10,
}),
};
const groups = {
@ -184,16 +195,21 @@ function run() {
.map((key) => tasks[key].value)
.filter(Boolean).length
) {
selection = prompts([
selection = prompts(
[
{
type: 'multiselect',
message: 'Select the bootstrap activities',
name: 'todo',
warn: ' ',
pageSize: Object.keys(tasks).length + Object.keys(groups).length,
choices,
},
],
{
type: 'multiselect',
message: 'Select the bootstrap activities',
name: 'todo',
warn: ' ',
pageSize: Object.keys(tasks).length + Object.keys(groups).length,
choices,
},
])
onCancel: () => process.exit(0),
}
)
.then(({ todo }) =>
todo.map((name) => tasks[Object.keys(tasks).find((i) => tasks[i].name === name)])
)