Skip to content

Commit

Permalink
fix(cli): remove unexpected boolean in execArgv
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 26, 2022
1 parent 91a872c commit 82cdfaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"lint": "eslint packages plugins --ext=ts --cache",
"pub": "yarn compile scripts && koishi-scripts pub",
"scaffold": "yarn compile koishi && yarn create-koishi test",
"start": "yarn compile && cross-env TS_NODE_PROJECT=../tsconfig.test.json yarn workspace test koishi start --watch .. -r ../build/register",
"start": "yarn compile && cross-env TS_NODE_PROJECT=../tsconfig.test.json yarn workspace test koishi start --watch .. -r ../build/register --experimental-vm-modules",
"shiki": "yarn workspace bot-shiki"
},
"version": "1.0.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/cli/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ function createWorker(options: Dict<any>) {
const execArgv = Object.entries(options).flatMap<string>(([key, value]) => {
if (key === '--') return []
key = toArg(key)
if (Array.isArray(value)) {
if (value === true) {
return [key]
} else if (value === false) {
return ['--no-' + key.slice(2)]
} else if (Array.isArray(value)) {
return value.flatMap(value => [key, value])
} else {
return [key, value]
Expand Down

0 comments on commit 82cdfaa

Please sign in to comment.