Skip to content

Commit 87981f7

Browse files
committed
feat: 1. add bug parameter 2. fix spawn bug in Windows
1 parent dbf9e89 commit 87981f7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import routeCommand from './commands/route/index.js';
1616
import routine from './commands/routine/index.js';
1717
import site from './commands/site/index.js';
1818
import t from './i18n/index.js';
19+
import logger from './libs/logger.js';
1920
import { handleCheckVersion, checkCLIVersion } from './utils/checkVersion.js';
2021
import { getCliConfig } from './utils/fileUtils/index.js';
2122

@@ -33,6 +34,9 @@ const main = async () => {
3334
.wrap(null)
3435
.help()
3536
.middleware(async (argv) => {
37+
if (argv.debug) {
38+
logger.setLogLevel('debug');
39+
}
3640
try {
3741
// Pass current command (first positional) so version check can decide prompting behavior
3842
await checkCLIVersion(
@@ -53,6 +57,11 @@ const main = async () => {
5357
.options('help', {
5458
describe: t('main_help_describe').d('Show help'),
5559
alias: 'h'
60+
})
61+
.options('debug', {
62+
describe: t('dev_option_debugger').d('Output debug logs'),
63+
type: 'boolean',
64+
default: false
5665
});
5766

5867
esa.command(

0 commit comments

Comments
 (0)