Skip to content

Commit

Permalink
new: Add global --debug flag. (#169)
Browse files Browse the repository at this point in the history
* Add debug arg.

* Bump

* Update lock.
  • Loading branch information
milesj authored Nov 23, 2022
1 parent 88f2cb6 commit 0601e7b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/packemon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"babel-plugin-env-constants": "^2.0.2",
"babel-preset-solid": "^1.6.0",
"browserslist": "^4.21.4",
"debug": "^4.3.4",
"execa": "^5.1.1",
"fast-glob": "^3.2.12",
"filesize": "^10.0.5",
Expand Down
5 changes: 5 additions & 0 deletions packages/packemon/src/bin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import debug from 'debug';
import { checkPackageOutdated, Program } from '@boost/cli';
import { getVersion } from './helpers/getVersion';
import {
Expand All @@ -21,6 +22,10 @@ try {
// Ignore
}

if (process.argv.includes('--debug')) {
debug.enable('packemon:*');
}

async function run() {
const program = new Program({
bin: 'packemon',
Expand Down
3 changes: 3 additions & 0 deletions packages/packemon/src/commands/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export abstract class BaseCommand<
@Arg.String('Current working directory to run in', { category: 'global' })
cwd: string = '';

@Arg.Flag('Enable debug logs', { category: 'global' })
debug: boolean = false;

@Arg.String('Only generate specific output formats', { category: 'filter', short: 'f' })
formats: string = '';

Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16669,6 +16669,7 @@ __metadata:
babel-plugin-env-constants: ^2.0.2
babel-preset-solid: ^1.6.0
browserslist: ^4.21.4
debug: ^4.3.4
execa: ^5.1.1
fast-glob: ^3.2.12
filesize: ^10.0.5
Expand Down

0 comments on commit 0601e7b

Please sign in to comment.