From 136134de605f73a168423dc857bfa2a32f3aa995 Mon Sep 17 00:00:00 2001 From: Alexey Zinoviev Date: Thu, 25 Jan 2024 13:28:50 +0700 Subject: [PATCH] ezqms-538: allow command contributions to dev tool (#4440) Signed-off-by: Alexey Zinoviev --- dev/tool/src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/tool/src/index.ts b/dev/tool/src/index.ts index 4c338d2142..25ee149d0d 100644 --- a/dev/tool/src/index.ts +++ b/dev/tool/src/index.ts @@ -43,7 +43,7 @@ import { import serverToken, { decodeToken, generateToken } from '@hcengineering/server-token' import toolPlugin, { FileModelLogger } from '@hcengineering/server-tool' -import { program } from 'commander' +import { program, Command } from 'commander' import { Db, MongoClient } from 'mongodb' import { clearTelegramHistory } from './telegram' import { diffWorkspace } from './workspace' @@ -78,7 +78,8 @@ export function devTool ( version: Data migrateOperations: [string, MigrateOperation][] }, - productId: string + productId: string, + extendProgram?: (prog: Command) => void ): void { const serverSecret = process.env.SERVER_SECRET if (serverSecret === undefined) { @@ -603,5 +604,7 @@ export function devTool ( await fixSkills(mongodbUri, getWorkspaceId(workspace, productId), transactorUrl, step) }) + extendProgram?.(program) + program.parse(process.argv) }