/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/cli/cloud/src/bin.ts
38 строк
1 KB
Melo Ortega
fix: add missing userid to amplitude events
11 авг 2025, 13:39
11 авг 2025, 13:39
3780331
Код
Авторство
О чём код?
import { Command } from 'commander'; import { createLogger } from './services'; import { getContext, setContext } from './services/context'; import { CLIContext } from './types'; import { buildStrapiCloudCommands } from './index'; function loadStrapiCloudCommand(argv = process.argv, command = new Command()) { // Initial program setup command.storeOptionsAsProperties(false).allowUnknownOption(true); // Help command command.helpOption('-h, --help', 'Display help for command'); command.addHelpCommand('help [command]', 'Display help for command'); const cwd = process.cwd(); const hasDebug = argv.includes('--debug'); const hasSilent = argv.includes('--silent'); const logger = createLogger({ debug: hasDebug, silent: hasSilent, timestamp: false }); setContext({ user: { id: '' }, cwd, logger, }); const ctx: CLIContext = getContext(); buildStrapiCloudCommands({ command, ctx, argv }); } function runStrapiCloudCommand(argv = process.argv, command = new Command()) { loadStrapiCloudCommand(argv, command); command.parse(argv); } export { runStrapiCloudCommand };