2022-06-09 17:09:07 -04:00
|
|
|
const { execSync } = require('child_process');
|
2018-06-25 15:30:37 -04:00
|
|
|
const chalk = require('chalk');
|
|
|
|
|
|
|
|
// check that fsevents is available if we're on macOS
|
|
|
|
if (process.platform === 'darwin') {
|
|
|
|
try {
|
|
|
|
require.resolve('fsevents');
|
|
|
|
} catch (e) {
|
|
|
|
console.error(`${chalk.red('error')} Dependency postinstall check failed.`);
|
|
|
|
console.error(
|
|
|
|
chalk.red(`
|
|
|
|
The fsevents driver is not installed properly.
|
|
|
|
If you are running a new version of Node, please
|
|
|
|
ensure that it is supported by the fsevents library.
|
|
|
|
|
|
|
|
You can try installing again with \`${chalk.cyan('yarn install --force')}\`
|
2019-03-08 11:59:15 -05:00
|
|
|
`),
|
2018-06-25 15:30:37 -04:00
|
|
|
);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log(`${chalk.green('success')} Dependency postinstall check passed.`);
|
2022-06-09 17:09:07 -04:00
|
|
|
|
|
|
|
// Apply any patches to our packages
|
|
|
|
// See https://gitlab.com/gitlab-org/gitlab/-/issues/336138
|
|
|
|
execSync('node_modules/.bin/patch-package --error-on-fail');
|
|
|
|
console.log(`${chalk.green('success')} Packages successfully patched.`);
|