From c6e11b5e8030c5491dbea700fa411fe6f4bdf99b Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 21 Oct 2014 14:51:07 -0400 Subject: [PATCH] Config now extends defaults instead of replacing --- gulpfile.js | 20 +++++++++++--------- package.json | 1 + tasks/admin/docs.json | 12 ++++++------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 712e6158f..31d9294d2 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,6 +14,7 @@ var // node components & oddballs del = require('del'), fs = require('fs'), + extend = require('extend'), path = require('path'), console = require('better-console'), wrench = require('wrench'), @@ -53,15 +54,15 @@ var // local overwrite = true, - // default settings - base = defaults.base, - clean = defaults.paths.clean, - output = defaults.paths.output, - source = defaults.paths.source, - // derived config, package, + + base, + clean, + output, + source, + assetPaths, componentGlob, @@ -95,6 +96,7 @@ var if(!config) { config = defaults; } + config = extend(true, {}, defaults, config); // shorthand base = config.base; @@ -432,11 +434,11 @@ gulp.task('install', 'Set-up project for first time', function () { siteDestination = answers.site || defaults.folders.site, - pathToSite = path.relative(path.resolve(defaults.folders.theme), path.resolve('./' + siteDestination)), + pathToSite = path.relative(path.resolve(defaults.folders.theme), path.resolve(siteDestination)), sitePathReplace = "@siteFolder : '" + pathToSite + "/';", configExists = fs.existsSync(defaults.files.config), - themeConfigExists = fs.existsSync(defaults.files.site), + themeConfigExists = fs.existsSync(defaults.files.theme), siteExists = fs.existsSync(siteDestination), jsonSource = (configExists) @@ -470,7 +472,7 @@ gulp.task('install', 'Set-up project for first time', function () { wrench.copyDirSyncRecursive(defaults.templates.site, siteDestination, settings.wrench.recursive); // adjust less variable for site folder location - console.info('Adjusting @siteFolder', pathToSite); + console.info('Adjusting @siteFolder', sitePathReplace); if(themeConfigExists) { gulp.src(defaults.files.site) .pipe(replace(siteVariable, sitePathReplace)) diff --git a/package.json b/package.json index 14ef82afc..d4fde4985 100755 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "devDependencies": { "better-console": "^0.2.3", "del": "^0.1.3", + "extend": "^2.0.0", "gulp": "^3.8.8", "gulp-autoprefixer": "^1.0.1", "gulp-batch": "^1.0.1", diff --git a/tasks/admin/docs.json b/tasks/admin/docs.json index ee8168b62..def2e8a3e 100644 --- a/tasks/admin/docs.json +++ b/tasks/admin/docs.json @@ -8,12 +8,12 @@ "themes": "src/themes/" }, "output": { - "less": "../docs/server/files/src/", - "packaged": "../docs/server/files/dist/", - "uncompressed": "../docs/server/files/dist/components/", - "compressed": "../docs/server/files/dist/components/", - "themes": "../docs/server/files/dist/themes/" + "less": "../docs/out/src/", + "packaged": "../docs/out/dist/", + "uncompressed": "../docs/out/dist/components/", + "compressed": "../docs/out/dist/components/", + "themes": "../docs/out/dist/themes/" }, - "clean": "../docs/server/files/dist/" + "clean": "../docs/out/dist/" } } \ No newline at end of file