|
@ -14,6 +14,7 @@ var |
|
|
// node components & oddballs
|
|
|
// node components & oddballs
|
|
|
del = require('del'), |
|
|
del = require('del'), |
|
|
fs = require('fs'), |
|
|
fs = require('fs'), |
|
|
|
|
|
extend = require('extend'), |
|
|
path = require('path'), |
|
|
path = require('path'), |
|
|
console = require('better-console'), |
|
|
console = require('better-console'), |
|
|
wrench = require('wrench'), |
|
|
wrench = require('wrench'), |
|
@ -53,15 +54,15 @@ var |
|
|
// local
|
|
|
// local
|
|
|
overwrite = true, |
|
|
overwrite = true, |
|
|
|
|
|
|
|
|
// default settings
|
|
|
|
|
|
base = defaults.base, |
|
|
|
|
|
clean = defaults.paths.clean, |
|
|
|
|
|
output = defaults.paths.output, |
|
|
|
|
|
source = defaults.paths.source, |
|
|
|
|
|
|
|
|
|
|
|
// derived
|
|
|
// derived
|
|
|
config, |
|
|
config, |
|
|
package, |
|
|
package, |
|
|
|
|
|
|
|
|
|
|
|
base, |
|
|
|
|
|
clean, |
|
|
|
|
|
output, |
|
|
|
|
|
source, |
|
|
|
|
|
|
|
|
assetPaths, |
|
|
assetPaths, |
|
|
componentGlob, |
|
|
componentGlob, |
|
|
|
|
|
|
|
@ -95,6 +96,7 @@ var |
|
|
if(!config) { |
|
|
if(!config) { |
|
|
config = defaults; |
|
|
config = defaults; |
|
|
} |
|
|
} |
|
|
|
|
|
config = extend(true, {}, defaults, config); |
|
|
|
|
|
|
|
|
// shorthand
|
|
|
// shorthand
|
|
|
base = config.base; |
|
|
base = config.base; |
|
@ -432,11 +434,11 @@ gulp.task('install', 'Set-up project for first time', function () { |
|
|
|
|
|
|
|
|
siteDestination = answers.site || defaults.folders.site, |
|
|
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 + "/';", |
|
|
sitePathReplace = "@siteFolder : '" + pathToSite + "/';", |
|
|
|
|
|
|
|
|
configExists = fs.existsSync(defaults.files.config), |
|
|
configExists = fs.existsSync(defaults.files.config), |
|
|
themeConfigExists = fs.existsSync(defaults.files.site), |
|
|
|
|
|
|
|
|
themeConfigExists = fs.existsSync(defaults.files.theme), |
|
|
siteExists = fs.existsSync(siteDestination), |
|
|
siteExists = fs.existsSync(siteDestination), |
|
|
|
|
|
|
|
|
jsonSource = (configExists) |
|
|
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); |
|
|
wrench.copyDirSyncRecursive(defaults.templates.site, siteDestination, settings.wrench.recursive); |
|
|
|
|
|
|
|
|
// adjust less variable for site folder location
|
|
|
// adjust less variable for site folder location
|
|
|
console.info('Adjusting @siteFolder', pathToSite); |
|
|
|
|
|
|
|
|
console.info('Adjusting @siteFolder', sitePathReplace); |
|
|
if(themeConfigExists) { |
|
|
if(themeConfigExists) { |
|
|
gulp.src(defaults.files.site) |
|
|
gulp.src(defaults.files.site) |
|
|
.pipe(replace(siteVariable, sitePathReplace)) |
|
|
.pipe(replace(siteVariable, sitePathReplace)) |
|
|