From 3c6a0b65fb8d7b864d0288a745d9e8a517e49791 Mon Sep 17 00:00:00 2001 From: Wasin Thonkaew Date: Wed, 19 Oct 2016 19:43:33 +0700 Subject: [PATCH] Fix start command to properly process v2 local directory template In v2, 'src' folder should not be copied into destination 'www' folder of generated project. This changes fixed it. --- lib/start.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/start.js b/lib/start.js index 15740e2..e834c68 100644 --- a/lib/start.js +++ b/lib/start.js @@ -469,10 +469,19 @@ Start.fetchLocalStarter = function(options) { return q.promise; } - log.info('\nCopying files to www from:'.bold, localStarterPath); + // for v2, copy both 'src' and 'www' folder to target path + if (options.v2) { + log.info('\nCopying files to project from:'.bold, localStarterPath); + + shelljs.cp('-Rf', path.join(localStarterPath, '*'), options.targetPath); + } + // for v1, only focus on 'www' folder + else { + log.info('\nCopying files to www folder from:'.bold, localStarterPath); - // Move the content of this repo into the www folder - shelljs.cp('-Rf', path.join(localStarterPath, '*'), path.join(options.targetPath, 'www')); + // Move the content of this repo into the www folder + shelljs.cp('-Rf', path.join(localStarterPath, '*'), path.join(options.targetPath, 'www')); + } q.resolve(); } catch (e) {