Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat(core): Add --debug flag to the CLI #1010

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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