forked from roninoss/create-expo-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.ts
27 lines (24 loc) · 838 Bytes
/
cli.ts
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
import { build } from 'gluegun'
/**
* Create the cli and kick it off
*/
export async function run() {
const argv = process.env.argv
// create a CLI runtime
const cli = build()
.brand('create-expo-stack')
.src(__dirname)
.plugins('./node_modules', {
matching: 'create-expo-stack-*',
hidden: true,
})
.version() // provides default for version, v, --version, -v
.create()
// enable the following method if you'd like to skip loading one of these core extensions
// this can improve performance if they're not necessary for your project:
// .exclude(['meta', 'strings', 'print', 'filesystem', 'semver', 'system', 'prompt', 'http', 'template', 'patching', 'package-manager'])
// and run it
const toolbox = await cli.run(argv)
// send it back (for testing, mostly)
return toolbox
}