From 8c2f65ccd3c5af1a9087e9d2be9b75e86477beef Mon Sep 17 00:00:00 2001 From: Noam Amit Date: Mon, 16 Jan 2017 16:16:40 +0200 Subject: [PATCH] Merge the OTB colors.json with the defined one in the package to avoid compilation probelms on changes to the OTB colors.json --- gulp/tasks/build-scss.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gulp/tasks/build-scss.js b/gulp/tasks/build-scss.js index 5403c477..c22f45fc 100644 --- a/gulp/tasks/build-scss.js +++ b/gulp/tasks/build-scss.js @@ -19,10 +19,12 @@ let zlib = require('zlib'); let tar = require('tar-fs'); let stylesBaseDir = 'www/styles/partials'; let templateFile = stylesBaseDir+'/_variables.tmpl.scss'; +let OTBColorsFile = stylesBaseDir+'/../colors.json'; let scssFile = '_variables.scss'; var runSequence = require('run-sequence'); let fs = require('fs'); let del = require('del'); +let lodashMerge = require('lodash/merge'); gulp.task('cleanup',()=> del(['www'])); @@ -38,10 +40,11 @@ gulp.task('extract-scss-files', () => { .pipe(tar.extract('.')) }); gulp.task('color-variables',() => { - let colorVariables =JSON.parse(fs.readFileSync(config.viewCssDir() + '/../colors.json', 'utf8')); - console.log(colorVariables.links); + let colorVariables = JSON.parse(fs.readFileSync(config.viewCssDir() + '/../colors.json', 'utf8')); + let colorVariablesOTB =JSON.parse(fs.readFileSync(OTBColorsFile, 'utf8')); + let colorsMeregd = lodashMerge(colorVariablesOTB, colorVariables); return gulp.src(templateFile) - .pipe(template(colorVariables)) + .pipe(template(colorsMeregd)) .pipe(rename(scssFile)) .pipe(gulp.dest(stylesBaseDir)); });