File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ process.on('exit', function () {
6464var template = program . args [ 0 ]
6565var hasSlash = template . indexOf ( '/' ) > - 1
6666var rawName = program . args [ 1 ]
67+ var templatePath = exists ( template ) ? template : path . normalize ( path . join ( process . cwd ( ) , template ) )
6768var inPlace = ! rawName || rawName === '.'
6869var name = inPlace ? path . relative ( '../' , process . cwd ( ) ) : rawName
6970var to = path . resolve ( rawName || '.' )
@@ -91,8 +92,8 @@ if (exists(to)) {
9192
9293function run ( ) {
9394 // check if template is local
94- if ( hasSlash && exists ( template ) ) {
95- generate ( name , template , to , function ( err ) {
95+ if ( exists ( templatePath ) ) {
96+ generate ( name , templatePath , to , function ( err ) {
9697 if ( err ) logger . fatal ( err )
9798 console . log ( )
9899 logger . success ( 'Generated "%s".' , name )
You can’t perform that action at this time.
0 commit comments