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 () {
64
64
var template = program . args [ 0 ]
65
65
var hasSlash = template . indexOf ( '/' ) > - 1
66
66
var rawName = program . args [ 1 ]
67
+ var templatePath = path . normalize ( path . join ( process . cwd ( ) , template ) )
67
68
var inPlace = ! rawName || rawName === '.'
68
69
var name = inPlace ? path . relative ( '../' , process . cwd ( ) ) : rawName
69
70
var to = path . resolve ( rawName || '.' )
@@ -91,8 +92,8 @@ if (exists(to)) {
91
92
92
93
function run ( ) {
93
94
// 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 ) {
96
97
if ( err ) logger . fatal ( err )
97
98
console . log ( )
98
99
logger . success ( 'Generated "%s".' , name )
You can’t perform that action at this time.
0 commit comments