From ef2cfc4c3d72902c35b4dbbf833b03bbe3241a55 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 22 Dec 2014 15:12:52 -0500 Subject: [PATCH] #1476, maintainer: watch now watches for changes in definition (regression in 0.13.0) --- gulpfile.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 46bfcf921..9cf5e142d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -194,6 +194,7 @@ gulp.task('watch', 'Watch for site/theme changes (Default Task)', function(callb stream, compressedStream, uncompressedStream, + isDefinition, isPackagedTheme, isSiteTheme, isConfig @@ -204,25 +205,28 @@ gulp.task('watch', 'Watch for site/theme changes (Default Task)', function(callb ; // recompile on *.override , *.variable change + isDefinition = (file.path.indexOf(source.definitions) !== -1); isPackagedTheme = (file.path.indexOf(source.themes) !== -1); isSiteTheme = (file.path.indexOf(source.site) !== -1); isConfig = (file.path.indexOf('.config') !== -1); - if(isPackagedTheme || isSiteTheme) { + if(isDefinition || isPackagedTheme || isSiteTheme) { srcPath = util.replaceExtension(file.path, '.less'); srcPath = srcPath.replace(config.regExp.themePath, source.definitions); srcPath = srcPath.replace(source.site, source.definitions); } - if(isConfig) { + else if(isConfig) { console.log('Change detected in theme config'); gulp.start('build'); } + else { + srcPath = util.replaceExtension(file.path, '.less'); + } // get relative asset path (path returns wrong path? hardcoded) // assetPaths.source = path.relative(srcPath, path.resolve(source.themes)); assetPaths.source = '../../themes'; - if( fs.existsSync(srcPath) ) { // unified css stream @@ -480,7 +484,6 @@ gulp.task('install', 'Set-up project for first time', function () { .pipe(prompt.prompt(questions.setup, function(answers) { var siteVariable = /@siteFolder .*\'(.*)/mg, - siteDestination = answers.site || config.folders.site, pathToSite = path.relative(path.resolve(config.folders.theme), path.resolve(siteDestination)),