kernel-setup.mjs 562 B

1234567891011
  1. import {fileURLToPath} from 'node:url'
  2. import {dirname} from 'node:path'
  3. import {prepareKernel} from '../bin/lib/kernel-setup.mjs'
  4. import {isNpmInstallation} from '../bin/lib/npm-release.mjs'
  5. const root=dirname(dirname(fileURLToPath(import.meta.url)))
  6. // Source checkouts keep the explicit `npm run kernel:setup`; npm installs prepare on postinstall.
  7. if(!process.argv.includes('--postinstall')||isNpmInstallation(root)){
  8. try{await prepareKernel({root,force:process.argv.includes('--force')})}
  9. catch(error){console.error(error.message);process.exitCode=1}
  10. }