mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
refactor(core): Overhaul commands setup. Add support for module commands (#16709)
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
committed by
GitHub
parent
346bc84093
commit
9f8d3d3bc8
@@ -13,11 +13,6 @@ if (versionFlags.includes(process.argv.slice(-1)[0])) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (process.argv.length === 2) {
|
||||
// When no command is given choose by default start
|
||||
process.argv.push('start');
|
||||
}
|
||||
|
||||
const satisfies = require('semver/functions/satisfies');
|
||||
const nodeVersion = process.versions.node;
|
||||
const {
|
||||
@@ -63,10 +58,7 @@ if (process.env.NODEJS_PREFER_IPV4 === 'true') {
|
||||
require('net').setDefaultAutoSelectFamily?.(false);
|
||||
|
||||
(async () => {
|
||||
// Collect DB entities from modules _before_ `DbConnectionOptions` is instantiated.
|
||||
const { BaseCommand } = await import('../dist/commands/base-command.js');
|
||||
await new BaseCommand([], { root: __dirname }).loadModules();
|
||||
|
||||
const oclif = await import('@oclif/core');
|
||||
await oclif.execute({ dir: __dirname });
|
||||
const { Container } = await import('@n8n/di');
|
||||
const { CommandRegistry } = await import('../dist/command-registry.js');
|
||||
await Container.get(CommandRegistry).execute();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user