Skip to content

Commit

Permalink
✨ feat(core): Add --debug flag to the CLI (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception authored Nov 22, 2023
1 parent f36508b commit 96a413e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { footer } from './footer'
interface CliFlags {
headless: boolean
force: boolean
debug: boolean
}

// TODO: Add unit tests for the CLI!
Expand All @@ -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)
Expand All @@ -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) => {
Expand Down

0 comments on commit 96a413e

Please sign in to comment.