From e72377808474909059bce9ea50cf9087c5f1b633 Mon Sep 17 00:00:00 2001 From: Liang Gong Date: Mon, 22 Jan 2024 15:41:34 -0800 Subject: [PATCH] fix(cli): fix a bug in heap analysis command Summary: Fix a bug in heap analysis command for loading external heap analysis plugin. Differential Revision: D52978075 fbshipit-source-id: b87b3354e7cf44a7fdd9ef3e4991578785c815aa --- packages/cli/src/commands/heap/HeapAnalysisCommand.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/commands/heap/HeapAnalysisCommand.ts b/packages/cli/src/commands/heap/HeapAnalysisCommand.ts index d6c12b66..4938d302 100644 --- a/packages/cli/src/commands/heap/HeapAnalysisCommand.ts +++ b/packages/cli/src/commands/heap/HeapAnalysisCommand.ts @@ -82,9 +82,12 @@ export default class RunHeapAnalysisCommand extends BaseCommand { async run(options: CLIOptions): Promise { // process command line arguments and load analysis modules const args = options.cliArgs; - const plugin = options.configFromOptions?.heapAnalysisPlugin; + let plugin = options.configFromOptions?.heapAnalysisPlugin; + if (plugin != null) { + plugin = `${plugin}`; + } const analysisMap = heapAnalysisLoader.loadAllAnalysis({ - heapAnalysisPlugin: `${plugin}`, + heapAnalysisPlugin: plugin, errorWhenPluginFailed: true, });