Skip to content

Commit

Permalink
fix(core): fix support for --import option
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 1, 2024
1 parent 3916c33 commit 062dfe2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions packages/core/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@

import { start } from '@cordisjs/cli'

const args = process.argv.slice(2)

for (let i = 0; i < args.length; i++) {
if (args[i].startsWith('--import')) {
const [arg] = args.splice(i, 1)
let [, path] = arg.split('=')
if (!path) {
path = args.splice(i, 1)[0]
}
await import(path)
--i
for (let i = 2; i < process.argv.length; i++) {
if (!process.argv[i].startsWith('--import')) break
const [arg] = process.argv.splice(i, 1)
let [, path] = arg.split('=')
if (!path) {
path = process.argv.splice(i, 1)[0]
}
await import(path)
--i
}

await start({ name: 'yakumo' })
2 changes: 1 addition & 1 deletion packages/tsc/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function apply(ctx: Context) {
}
await Promise.all(tasks)
}
await fs.rm(join(cwd, 'tsconfig.temp.json'))
await fs.rm(join(cwd, 'tsconfig.temp.json')).catch(() => {})
}, {
boolean: ['clean'],
})
Expand Down

0 comments on commit 062dfe2

Please sign in to comment.