ezqms-538: allow command contributions to dev tool (#4440)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-01-25 13:28:50 +07:00 committed by GitHub
parent cf2df6ffe4
commit 136134de60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<Version>
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)
}