File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,13 +4,18 @@ import {resolve} from 'path';
44import { create } from '.' ;
55
66const templateRoot = resolve ( __dirname , '../templates' ) ;
7- const caveat = `Inside that directory, you can run several commands:
7+ const caveat = `
8+ Inside that directory, you can run several commands:
89yarn dev
910 Starts 'tsc -w'.
1011yarn build
1112 Build the app for production.
13+
14+ Read the doc for the further information:
15+ https://github.com/uetchy/create-whatever/blob/master/README.md
1216` ;
1317
14- create ( 'create-whatever' , templateRoot , {
18+ create ( 'create-whatever' , {
19+ templateRoot,
1520 caveat,
1621} ) ;
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface Config {
2626}
2727
2828export interface Options {
29+ templateRoot : string ;
2930 extra ?: Option ;
3031 caveat ?: string ;
3132 after ?: ( ) => void ;
@@ -129,11 +130,7 @@ async function getYargsOptions(
129130 return yargOption ;
130131}
131132
132- export async function create (
133- appName : string ,
134- templateRoot : string ,
135- options : Options = { } ,
136- ) {
133+ export async function create ( appName : string , options : Options ) {
137134 try {
138135 const firstArg = process . argv [ 2 ] ;
139136 if ( firstArg === undefined ) {
@@ -144,6 +141,7 @@ export async function create(
144141 ? path . basename ( process . cwd ( ) )
145142 : firstArg ;
146143 const packageDir = useCurrentDir ? process . cwd ( ) : path . resolve ( name ) ;
144+ const templateRoot = options . templateRoot ;
147145
148146 if ( isOccupied ( packageDir ) ) {
149147 throw new Error ( `${ packageDir } is not empty directory.` ) ;
Original file line number Diff line number Diff line change 33 "description" : " {{description}}" ,
44 "version" : " 0.0.0" ,
55 "dependencies" : {
6- "create-whatever" : " ^4 .0.0"
6+ "create-whatever" : " ^5 .0.0"
77 },
88 "author" : " {{contact}}" ,
99 "license" : " {{license}}" ,
Original file line number Diff line number Diff line change @@ -4,8 +4,12 @@ const {resolve} = require('path');
44const { create} = require ( 'create-whatever' ) ;
55
66const templateRoot = resolve ( __dirname , '../templates' ) ;
7- const caveat = `This is a caveat!
7+ const caveat = `
8+ This is a caveat!
89You can find this section in "src/cli.ts".
910` ;
1011
11- create ( '{{kebab name}}' , templateRoot , { caveat} ) ;
12+ create ( '{{kebab name}}' , {
13+ templateRoot,
14+ caveat,
15+ } ) ;
Original file line number Diff line number Diff line change 77 "dev" : " tsc -w"
88 },
99 "dependencies" : {
10- "create-whatever" : " ^4 .0.0"
10+ "create-whatever" : " ^5 .0.0"
1111 },
1212 "devDependencies" : {
1313 "shx" : " ^0.3.2" ,
Original file line number Diff line number Diff line change @@ -4,8 +4,12 @@ import {resolve} from 'path';
44import { create } from 'create-whatever' ;
55
66const templateRoot = resolve ( __dirname , '../templates' ) ;
7- const caveat = `This is a caveat!
7+ const caveat = `
8+ This is a caveat!
89You can find this section in "src/cli.ts".
910` ;
1011
11- create ( '{{kebab name}}' , templateRoot , { caveat} ) ;
12+ create ( '{{kebab name}}' , {
13+ templateRoot,
14+ caveat,
15+ } ) ;
You can’t perform that action at this time.
0 commit comments