From 5f90ced7a3673c2182c33d41517d430190b9e820 Mon Sep 17 00:00:00 2001 From: Daniel Izdebski Date: Wed, 22 Nov 2023 01:00:22 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(core):=20Add=20`--debug`=20fla?= =?UTF-8?q?g=20to=20the=20CLI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/cli/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/src/cli/index.ts b/packages/core/src/cli/index.ts index b2d110d32..562f9350d 100644 --- a/packages/core/src/cli/index.ts +++ b/packages/core/src/cli/index.ts @@ -13,6 +13,7 @@ import { footer } from './footer' interface CliFlags { headless: boolean force: boolean + debug: boolean } // TODO: Add unit tests for the CLI! @@ -29,6 +30,7 @@ export const main = async () => { false ) .option('-f, --force', 'Force the creation of cache even if it already exists', false) + .option('-d, --debug', 'If this flag is present, the compilation files are not going to be deleted', false) .helpOption(undefined, 'Display help for command') .addHelpText('afterAll', `\n${footer}\n`) .parse(process.argv) @@ -52,7 +54,9 @@ export const main = async () => { // TODO: We should be using `prepareExtension` function from the wallet itself! await createCache(compiledWalletSetupDirPath, prepareExtension, flags.force) - await rimraf(compiledWalletSetupDirPath) + if (!flags.debug) { + await rimraf(compiledWalletSetupDirPath) + } } main().catch((err) => {