2022-05-18 16:40:55 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2023-09-03 02:59:33 +00:00
|
|
|
const chalk = require('chalk');
|
2023-12-21 12:39:11 +00:00
|
|
|
const { initEnv, genTsConfigPaths } = require('../src/util');
|
2023-11-16 04:33:56 +00:00
|
|
|
|
2023-12-21 12:39:11 +00:00
|
|
|
initEnv();
|
2023-09-15 00:51:20 +00:00
|
|
|
genTsConfigPaths();
|
|
|
|
|
2023-09-03 02:59:33 +00:00
|
|
|
if (require('semver').satisfies(process.version, '<16')) {
|
|
|
|
console.error(chalk.red('[nocobase cli]: Node.js version must be >= 16'));
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
2024-11-06 05:14:26 +00:00
|
|
|
if (__dirname.includes(' ')) {
|
|
|
|
console.error(chalk.red(`[nocobase cli]: PathError: Invalid path "${process.cwd()}"`));
|
|
|
|
console.error(
|
|
|
|
chalk.red('[nocobase cli]: PathError: The path cannot contain spaces. Please modify the path and try again.'),
|
|
|
|
);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
2023-12-21 12:39:11 +00:00
|
|
|
// if (require('semver').satisfies(process.version, '>16') && !process.env.UNSET_NODE_OPTIONS) {
|
|
|
|
// if (process.env.NODE_OPTIONS) {
|
|
|
|
// let opts = process.env.NODE_OPTIONS;
|
|
|
|
// if (!opts.includes('--openssl-legacy-provider')) {
|
|
|
|
// opts = opts + ' --openssl-legacy-provider';
|
|
|
|
// }
|
|
|
|
// if (!opts.includes('--no-experimental-fetch')) {
|
|
|
|
// opts = opts + ' --no-experimental-fetch';
|
|
|
|
// }
|
|
|
|
// process.env.NODE_OPTIONS = opts;
|
|
|
|
// } else {
|
|
|
|
// process.env.NODE_OPTIONS = '--openssl-legacy-provider --no-experimental-fetch';
|
|
|
|
// }
|
|
|
|
// }
|
2023-02-10 03:16:36 +00:00
|
|
|
|
2022-05-18 16:40:55 +00:00
|
|
|
const cli = require('../src/cli');
|
|
|
|
|
|
|
|
cli.parse(process.argv);
|