-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathmain.ts
More file actions
30 lines (25 loc) · 810 Bytes
/
main.ts
File metadata and controls
30 lines (25 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import type { CommandDef } from 'citty'
import { defineCommand } from 'citty'
import { provider } from 'std-env'
import init from '../../nuxi/src/commands/init'
import { setupGlobalConsole } from '../../nuxi/src/utils/console'
import { checkEngines } from '../../nuxi/src/utils/engines'
import { logger } from '../../nuxi/src/utils/logger'
import { description, name, version } from '../package.json'
const _main = defineCommand({
meta: {
name,
version,
description,
},
args: init.args,
async setup(ctx) {
setupGlobalConsole({ dev: false })
// Check Node.js version and CLI updates in background
if (provider !== 'stackblitz') {
await checkEngines().catch(err => logger.error(err))
}
await init.run?.(ctx)
},
})
export const main = _main as CommandDef<any>