File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -6,12 +6,16 @@ const kleur = require('kleur')
66const path = require ( 'path' )
77const readline = require ( 'readline-sync' )
88
9+ const argv = process . argv . slice ( 2 )
10+
911/**
1012 * Prompt user for input to populate template files
1113 */
12- const npmName = readline . question (
13- '✍️ What is the npm name of your component? '
14- )
14+ const npmName = argv . includes ( '--test' )
15+ ? 'v-test'
16+ : readline . question (
17+ '✍️ What is the npm name of your component? '
18+ )
1519
1620const componentName = kebabcasify ( npmName )
1721const outDir = path . join ( process . cwd ( ) , componentName )
Original file line number Diff line number Diff line change 2121 " generator"
2222 ],
2323 "scripts" : {
24- "test" : " echo \" Info: no test specified\" "
24+ "test" : " echo \" Info: no test specified\" " ,
25+ "preview" : " node init --test && cd v-test && yarn --registry=https://registry.npm.taobao.org && yarn doc"
2526 },
2627 "dependencies" : {
2728 "fs-extra" : " ^7.0.1" ,
Original file line number Diff line number Diff line change 11<template >
22 <div class =" {{componentName}}" >
3+ hello
34 </div >
45</template >
56
You can’t perform that action at this time.
0 commit comments