Save files
@param  {Object} config
@param  {Array}  css_fonts
@return {Object}
14336
function saveFiles(config, [css, fonts]) {

	let res = Q().then(() => {
		let deferred = Q.defer()
		if(!config.simulate) {
			mkdirp(config.outputDir, error => {
				if(error) {
					deferred.reject(new Error(error))
				} else {
					deferred.resolve()
				}
			})
		} else {
			deferred.resolve()
		}
		return deferred.promise
	})
	fonts
		.forEach(({inputFont, outputFont, inputText, outputText}) => {
			res = res.then(() => {
				let deferred = Q.defer()
				let mime = 'font/woff2' // For Base64
				if(config.verbose)
					console.log(config.base64 ?
						`Writing in file ${inputFont}` :
						`Saving ${outputFont}`)
				let req = request({
					url: inputFont,
					header: {
						'User-Agent': config.userAgent
					}
				})
				.on('response', response => {
					if(config.base64) {
						mime = response.headers['content-type'] || 'font/woff2'
						deferred.resolve()
					}
				})
				.on('error', e => {
					deferred.reject(new Error(e))
				})
				if(!config.base64) {
					let file = path.resolve(config.outputDir, outputFont)
					css = css.replace(inputText, outputText);
					if(!config.simulate
					&&(config.overwriting
					  || !fs.existsSync(file))) {
						req.pipe(fs.createWriteStream(file))
						req.on('end', () => {
							deferred.resolve()
						})
					} else {
						if(!config.overwriting
						|| fs.existsSync(file)) {
							if(config.verbose)
								console.log('Passing - overwriting is disabled')
						}
						deferred.resolve()
					}
				} else {
					let chunks = []
					req.on('data', chunk => {
						chunks.push(chunk)
					}).on('end', (x) => {
						res = res.then(() => {
							let body = Buffer.concat(chunks).toString('base64')
							css = css.replace(inputText, `url('data:${mime};base64,${body}')`)
						})
					})
				}
				return deferred.promise
			})
		})
	res.then(() => {
		let deferred  = Q.defer()
		let file = path.resolve(config.outputDir, config.cssFile)
		if(config.verbose)
			console.log(`Saving ${path.basename(config.cssFile)}`)
		if(!config.simulate&&(config.overwriting||!fs.existsSync(file))) {
			fs.writeFile(file, css, 'utf8', e => {
				if(e) {
					deferred.reject(new Error(e))
					return;
				}
				deferred.resolve()
			})
		} else deferred.resolve()
		return deferred.promise
	})
	return res
}
1202345
function copyCss() {
  return gulp.src(['./src/assets/stylesheets/*.css'], {base: './src/assets/stylesheets'})
    .pipe(gulp.dest(function (file) {
      return libraryDist + '/dist/css' + file.base.slice(__dirname.length); // save directly to dist
    }));
}
766168
function parse_fonts(t, styles, themes, opts) {
	styles.Fonts = [];
	var font = {};
	var pass = false;
	t[0].match(tagregex).forEach(function(x) {
		var y = parsexmltag(x);
		switch(strip_ns(y[0])) {
			case '<fonts': case '<fonts>': case '</fonts>': break;

			/* 18.8.22 font CT_Font */
			case '<font': case '<font>': break;
			case '</font>': case '<font/>':
				styles.Fonts.push(font);
				font = {};
				break;

			/* 18.8.29 name CT_FontName */
			case '<name': if(y.val) font.name = y.val; break;
			case '<name/>': case '</name>': break;

			/* 18.8.2  b CT_BooleanProperty */
			case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
			case '<b/>': font.bold = 1; break;

			/* 18.8.26 i CT_BooleanProperty */
			case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
			case '<i/>': font.italic = 1; break;

			/* 18.4.13 u CT_UnderlineProperty */
			case '<u':
				switch(y.val) {
					case "none": font.underline = 0x00; break;
					case "single": font.underline = 0x01; break;
					case "double": font.underline = 0x02; break;
					case "singleAccounting": font.underline = 0x21; break;
					case "doubleAccounting": font.underline = 0x22; break;
				} break;
			case '<u/>': font.underline = 1; break;

			/* 18.4.10 strike CT_BooleanProperty */
			case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
			case '<strike/>': font.strike = 1; break;

			/* 18.4.2  outline CT_BooleanProperty */
			case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
			case '<outline/>': font.outline = 1; break;

			/* 18.8.36 shadow CT_BooleanProperty */
			case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
			case '<shadow/>': font.shadow = 1; break;

			/* 18.8.12 condense CT_BooleanProperty */
			case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
			case '<condense/>': font.condense = 1; break;

			/* 18.8.17 extend CT_BooleanProperty */
			case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
			case '<extend/>': font.extend = 1; break;

			/* 18.4.11 sz CT_FontSize */
			case '<sz': if(y.val) font.sz = +y.val; break;
			case '<sz/>': case '</sz>': break;

			/* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
			case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
			case '<vertAlign/>': case '</vertAlign>': break;

			/* 18.8.18 family CT_FontFamily */
			case '<family': if(y.val) font.family = parseInt(y.val,10); break;
			case '<family/>': case '</family>': break;

			/* 18.8.35 scheme CT_FontScheme */
			case '<scheme': if(y.val) font.scheme = y.val; break;
			case '<scheme/>': case '</scheme>': break;

			/* 18.4.1 charset CT_IntProperty */
			case '<charset':
				if(y.val == '1') break;
				y.codepage = CS2CP[parseInt(y.val, 10)];
				break;

			/* 18.?.? color CT_Color */
			case '<color':
				if(!font.color) font.color = {};
				if(y.auto) font.color.auto = parsexmlbool(y.auto);

				if(y.rgb) font.color.rgb = y.rgb.slice(-6);
				else if(y.indexed) {
					font.color.index = parseInt(y.indexed, 10);
					var icv = XLSIcv[font.color.index];
					if(font.color.index == 81) icv = XLSIcv[1];
					if(!icv) throw new Error(x);
					font.color.rgb = icv[0].toString(16) + icv[1].toString(16) + icv[2].toString(16);
				} else if(y.theme) {
					font.color.theme = parseInt(y.theme, 10);
					if(y.tint) font.color.tint = parseFloat(y.tint);
					if(y.theme && themes.themeElements && themes.themeElements.clrScheme) {
						font.color.rgb = rgb_tint(themes.themeElements.clrScheme[font.color.theme].rgb, font.color.tint || 0);
					}
				}

				break;
			case '<color/>': case '</color>': break;

			/* 18.2.10 extLst CT_ExtensionList ? */
			case '<extLst': case '<extLst>': case '</extLst>': break;
			case '<ext': pass = true; break;
			case '</ext>': pass = false; break;
			default: if(opts && opts.WTF) {
				if(!pass) throw new Error('unrecognized ' + y[0] + ' in fonts');
			}
		}
	});
}
1208232
function gulpSVGSprite(config) {

	// Extend plugin error
	function extendError(pError, error) {
		if (error && (typeof error === 'object')) {
			['name', 'errno'].forEach(function(property) {
				if (property in error) {
					this[property]	= error[property];
				}
			}, pError);
		}

		return pError;
	}

	// Instanciate spriter instance
	var spriter						= new SVGSpriter(config);
	var shapes						= 0;

	// Intercept error log and convert to plugin errors
	spriter.config.log.error		= function(message, error) {
		this.emit('error', extendError(new PluginError(PLUGIN_NAME, message), error));
	};

	return through2.obj(function (file, enc, cb) {
		var error					= null;
		try {
			spriter.add(file);
			++shapes;
		} catch(e) {
			error					= (!e.plugin || (e.plugin !== PLUGIN_NAME)) ? extendError(new PluginError(PLUGIN_NAME, e.message), e) : e;
		}
		return cb(error);

	}, function(cb) {
		var stream 					= this;
		spriter.compile(function(error, result /*, data*/){
			if (error) {
				stream.emit('error', new PluginError(PLUGIN_NAME, error));
			} else if (shapes > 0) {
				for (var mode in result) {
					for (var resource in result[mode]) {
						stream.push(result[mode][resource]);
					}
				}
			}
			cb();
		});
	});
}
733367
function () {
        var spans = {}
        for (var i = 0, l = fontList.length; i < l; i++) {
          var fontSpans = []
          for (var j = 0, numDefaultFonts = baseFonts.length; j < numDefaultFonts; j++) {
            var s = createSpanWithFonts(fontList[i], baseFonts[j])
            fontsDiv.appendChild(s)
            fontSpans.push(s)
          }
          spans[fontList[i]] = fontSpans // Stores {fontName : [spans for that font]}
        }
        return spans
      }
1011619
function getBundledCSS() {
    return streamqueue.obj(
        gulp.src(paths.dev.vendor + 'font-awesome/css/font-awesome.css')
            .pipe(modifyCssUrls({
                modify: function (url, filePath) {
                    return url.replace('../fonts/', '/fonts/font-awesome/');
                }
            })),
        gulp.src(paths.dev.vendor + 'bootstrap/dist/css/bootstrap.css')
            .pipe(modifyCssUrls({
                modify: function (url, filePath) {
                    return url.replace('../fonts/', '/fonts/bootstrap/');
                }
            })),
        gulp.src(paths.dev.vendor + 'nattreid-file-manager/assets/fileManager.css')
            .pipe(modifyCssUrls({
                modify: function (url, filePath) {
                    return url.replace('/images/', '/images/fileManager/');
                }
            })),
        gulp.src([
            paths.dev.vendor + 'jquery-ui-dist/jquery-ui.theme.css',
            paths.dev.vendor + 'bootstrap/dist/css/bootstrap-theme.css',
            paths.dev.vendor + 'bootstrap-daterangepicker/daterangepicker.css',
            paths.dev.vendor + 'nprogress/nprogress.css',
            // datagrid
            paths.dev.vendor + 'ublaboo-datagrid/assets/dist/datagrid.css',
            paths.dev.vendor + 'ublaboo-datagrid/assets/dist/datagrid-spinners.css',
            paths.dev.vendor + 'happy/dist/happy.css',
            paths.dev.vendor + 'bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
            paths.dev.vendor + 'bootstrap-select/dist/css/bootstrap-select.css',
            // spectrum
            paths.dev.vendor + 'spectrum-colorpicker/spectrum.css',
            // plugins
            paths.dev.vendor + 'nattreid-form/assets/form.css',
            paths.dev.vendor + 'nattreid-modal/assets/modal.min.css',
            // cms
            paths.dev.css + '*.css'
        ])
    );
}
126472
function saveFixture( name, data, directory ) {
    return fs.readFileAsync( template, 'utf8' )
      .then( function renderTemplate( template ) {
        return mustache.render( template, { stylesheets: stylesheets, sections: data } );
      }).then( function saveTemplate( templateData ) {
        return fs.outputFileAsync( destination + '/' + name + '.html', templateData );
      });
  }
1274209
public function saveActivity(string $config)
    {
        $debug    = $this->get("request")->get("debug");
        $cache    = $this->get("request")->get("cache");
        $compile  = $this->get("request")->get("compile");
        $force    = $this->get("request")->get("force");
        $sdebug   = $this->get("request")->get("sdebug");
        //$console  = $this->get("request")->get("console");

        if (!in_array($debug, array('true', 'false')) || !in_array($cache, array('0', '1')) ||
            !in_array($compile, array('true', 'false')) || !in_array($force, array('true', 'false')) ||
            !in_array($sdebug, array('true', 'false'))) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Error on smarty parameters")));
        }


        $file = JL::open(FEnv::get("framework.config").'smarty_config/smarty.json');
        if (!isset($file->$config)) {
            return ((new Renderer())->jsonRenderer(array("code" => 500, "msg" => "Error on smarty parameters")));
        }

        $file->$config->debug         = $this->setRealBoolean($debug);
        $file->$config->cache         = (int)$cache;
        $file->$config->compile_check = $this->setRealBoolean($compile);
        $file->$config->force_compile = $this->setRealBoolean($force);
        $file->$config->smarty_debug  = $this->setRealBoolean($sdebug);
        //$file->$config->console_debug = $console;

        JL::put(
            FEnv::get("framework.config")."smarty_config/smarty.json",
            json_encode($file, JSON_PRETTY_PRINT)
        );

        return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
    }
754653
function generateFont(done) {
			var engine = require('./engines/' + o.engine);
			engine(o, function(result) {
				if (result === false) {
					// Font was not created, exit
					completeTask();
					return;
				}

				if (result) {
					o = _.extend(o, result);
				}

				done();
			});
		}
740729
function getFontFeatureSettingsPrevTo(decl) {
  var fontFeatureSettings = null;
  decl.parent.walkDecls(function(decl) {
    if (decl.prop === "font-feature-settings") {
      fontFeatureSettings = decl;
    }
  })

  if (fontFeatureSettings === null) {
    fontFeatureSettings = decl.clone()
    fontFeatureSettings.prop = "font-feature-settings"
    fontFeatureSettings.value = ""
    decl.parent.insertBefore(decl, fontFeatureSettings)
  }
  return fontFeatureSettings
}
405750
function writeFile(file, css) {
  return new Promise((resolve, reject) => {
    fs.writeFile(file, css, err => {
      if (err) {
        return reject(err);
      }
      resolve();
    })
  });
}
863843
function parser(config) {
    chevrotain.Parser.call(this, cssTokens, config)

    var $ = this

    this.RULE("stylesheet", function() {
        // [ CHARSET_SYM STRING ';' ]?
        $.OPTION(function() {
            $.SUBRULE($.charsetHeader)
        })

        // [S|CDO|CDC]*
        $.SUBRULE($.cdcCdo)

        // [ import [ CDO S* | CDC S* ]* ]*
        $.MANY(function() {
            $.SUBRULE($.cssImport)
            $.SUBRULE2($.cdcCdo)
        })

        // [ [ ruleset | media | page ] [ CDO S* | CDC S* ]* ]*
        $.MANY2(function() {
            $.SUBRULE($.contents)
        })
    })

    this.RULE("charsetHeader", function() {
        $.CONSUME(CharsetSym)
        $.CONSUME(StringLiteral)
        $.CONSUME(SemiColon)
    })

    this.RULE("contents", function() {
        // prettier-ignore
        $.OR([
            {ALT: function() {$.SUBRULE($.ruleset)}},
            {ALT: function() {$.SUBRULE($.media)}},
            {ALT: function() {$.SUBRULE($.page)}}
        ])
        $.SUBRULE3($.cdcCdo)
    })

    // factor out repeating pattern for cdc/cdo
    this.RULE("cdcCdo", function() {
        $.MANY(function() {
            // prettier-ignore
            $.OR([
                {ALT: function() {$.CONSUME(Cdo)}},
                {ALT: function() {$.CONSUME(Cdc)}}
            ])
        })
    })

    // IMPORT_SYM S*
    // [STRING|URI] S* media_list? ';' S*
    this.RULE("cssImport", function() {
        $.CONSUME(ImportSym)
        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(StringLiteral)}},
            {ALT: function() {$.CONSUME(Uri)}}
        ])

        $.OPTION(function() {
            $.SUBRULE($.media_list)
        })

        $.CONSUME(SemiColon)
    })

    // MEDIA_SYM S* media_list '{' S* ruleset* '}' S*
    this.RULE("media", function() {
        $.CONSUME(MediaSym)
        $.SUBRULE($.media_list)
        $.CONSUME(LCurly)
        $.SUBRULE($.ruleset)
        $.CONSUME(RCurly)
    })

    // medium [ COMMA S* medium]*
    this.RULE("media_list", function() {
        $.SUBRULE($.medium)
        $.MANY_SEP({
            SEP: Comma,
            DEF: function() {
                $.SUBRULE2($.medium)
            }
        })
    })

    // IDENT S*
    this.RULE("medium", function() {
        $.CONSUME(Ident)
    })

    // PAGE_SYM S* pseudo_page?
    // '{' S* declaration? [ ';' S* declaration? ]* '}' S*
    this.RULE("page", function() {
        $.CONSUME(PageSym)
        $.OPTION(function() {
            $.SUBRULE($.pseudo_page)
        })

        $.SUBRULE($.declarationsGroup)
    })

    // '{' S* declaration? [ ';' S* declaration? ]* '}' S*
    // factored out repeating grammar pattern
    this.RULE("declarationsGroup", function() {
        $.CONSUME(LCurly)
        $.OPTION(function() {
            $.SUBRULE($.declaration)
        })

        $.MANY(function() {
            $.CONSUME(SemiColon)
            $.OPTION2(function() {
                $.SUBRULE2($.declaration)
            })
        })
        $.CONSUME(RCurly)
    })

    // ':' IDENT S*
    this.RULE("pseudo_page", function() {
        $.CONSUME(Colon)
        $.CONSUME(Ident)
    })

    // '/' S* | ',' S*
    this.RULE("operator", function() {
        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Slash)}},
            {ALT: function() {$.CONSUME(Comma)}}
        ])
    })

    // '+' S* | '>' S*
    this.RULE("combinator", function() {
        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Plus)}},
            {ALT: function() {$.CONSUME(GreaterThan)}}
        ])
    })

    // '-' | '+'
    this.RULE("unary_operator", function() {
        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Minus)}},
            {ALT: function() {$.CONSUME(Plus)}}
        ])
    })

    // IDENT S*
    this.RULE("property", function() {
        $.CONSUME(Ident)
    })

    // selector [ ',' S* selector ]*
    // '{' S* declaration? [ ';' S* declaration? ]* '}' S*
    this.RULE("ruleset", function() {
        $.MANY_SEP({
            SEP: Comma,
            DEF: function() {
                $.SUBRULE($.selector)
            }
        })

        $.SUBRULE($.declarationsGroup)
    })

    // simple_selector [ combinator selector | S+ [ combinator? selector ]? ]?
    this.RULE("selector", function() {
        $.SUBRULE($.simple_selector)
        $.OPTION(function() {
            $.OPTION2(function() {
                $.SUBRULE($.combinator)
            })
            $.SUBRULE($.selector)
        })
    })

    // element_name [ HASH | class | attrib | pseudo ]*
    // | [ HASH | class | attrib | pseudo ]+
    this.RULE("simple_selector", function() {
        $.OR([
            {
                ALT: function() {
                    $.SUBRULE($.element_name)
                    $.MANY(function() {
                        $.SUBRULE($.simple_selector_suffix)
                    })
                }
            },
            {
                ALT: function() {
                    $.AT_LEAST_ONE(function() {
                        $.SUBRULE2($.simple_selector_suffix)
                    }, "selector suffix")
                }
            }
        ])
    })

    // helper grammar rule to avoid repetition
    // [ HASH | class | attrib | pseudo ]+
    this.RULE("simple_selector_suffix", function() {
        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Hash)}},
            {ALT: function() {$.SUBRULE($.class)}},
            {ALT: function() {$.SUBRULE($.attrib)}},
            {ALT: function() {$.SUBRULE($.pseudo)}}
        ])
    })

    // '.' IDENT
    this.RULE("class", function() {
        $.CONSUME(Dot)
        $.CONSUME(Ident)
    })

    // IDENT | '*'
    this.RULE("element_name", function() {
        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Ident)}},
            {ALT: function() {$.CONSUME(Star)}}
        ])
    })

    // '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* [ IDENT | STRING ] S* ]? ']'
    this.RULE("attrib", function() {
        $.CONSUME(LSquare)
        $.CONSUME(Ident)

        this.OPTION(function() {
            // prettier-ignore
            $.OR([
                {ALT: function() {$.CONSUME(Equals)}},
                {ALT: function() {$.CONSUME(Includes)}},
                {ALT: function() {$.CONSUME(Dasmatch)}}
            ])

            // prettier-ignore
            $.OR2([
                {ALT: function() {$.CONSUME2(Ident)}},
                {ALT: function() {$.CONSUME(StringLiteral)}}
            ])
        })
        $.CONSUME(RSquare)
    })

    // ':' [ IDENT | FUNCTION S* [IDENT S*]? ')' ]
    this.RULE("pseudo", function() {
        $.CONSUME(Colon)

        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Ident)}},
            {
                ALT: function() {
                    $.CONSUME(Func)
                    $.OPTION(function() {
                        $.CONSUME2(Ident)
                    })
                    $.CONSUME(RParen)
                }
            }
        ])
    })

    // property ':' S* expr prio?
    this.RULE("declaration", function() {
        $.SUBRULE($.property)
        $.CONSUME(Colon)
        $.SUBRULE($.expr)

        $.OPTION(function() {
            $.SUBRULE($.prio)
        })
    })

    // IMPORTANT_SYM S*
    this.RULE("prio", function() {
        $.CONSUME(ImportantSym)
    })

    // term [ operator? term ]*
    this.RULE("expr", function() {
        $.SUBRULE($.term)
        $.MANY(function() {
            $.OPTION(function() {
                $.SUBRULE($.operator)
            })
            $.SUBRULE2($.term)
        })
    })

    // unary_operator?
    // [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
    // TIME S* | FREQ S* ]
    // | STRING S* | IDENT S* | URI S* | hexcolor | function
    this.RULE("term", function() {
        $.OPTION(function() {
            $.SUBRULE($.unary_operator)
        })

        // prettier-ignore
        $.OR([
            {ALT: function() {$.CONSUME(Num)}},
            {ALT: function() {$.CONSUME(Percentage)}},
            {ALT: function() {$.CONSUME(Length)}},
            {ALT: function() {$.CONSUME(Ems)}},
            {ALT: function() {$.CONSUME(Exs)}},
            {ALT: function() {$.CONSUME(Angle)}},
            {ALT: function() {$.CONSUME(Time)}},
            {ALT: function() {$.CONSUME(Freq)}},
            {ALT: function() {$.CONSUME(StringLiteral)}},
            {ALT: function() {$.CONSUME(Ident)}},
            {ALT: function() {$.CONSUME(Uri)}},
            {ALT: function() {$.SUBRULE($.hexcolor)}},
            {ALT: function() {$.SUBRULE($.cssFunction)}}
        ])
    })

    // FUNCTION S* expr ')' S*
    this.RULE("cssFunction", function() {
        $.CONSUME(Func)
        $.SUBRULE($.expr)
        $.CONSUME(RParen)
    })

    this.RULE("hexcolor", function() {
        $.CONSUME(Hash)
    })

    // very important to call this after all the rules have been setup.
    // otherwise the parser may not work correctly as it will lack information
    // derived from the self analysis.
    this.performSelfAnalysis()
}
509085
function rewriteFonts () {
  const style = path.join(target, 'css', 'style.css')
  const css = fs.readFileSync(style)
    .toString()
    .replace(/@import url\(.*?Roboto.*?\);/, `@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro:400,600');`)
    .replace(/Roboto/g, 'Open Sans')

  fs.writeFileSync(style, `
    ${css}

    code {
      font-family: 'Source Code Pro', monospace;
    }

    pre > code {
      padding: 0.75em 1em;
      line-height: 1.5em;
    }

    ul, ol {
      margin-bottom: 15px;
    }

    hr {
      border: 0;
      height: 2px;
      background: #f5f5f5;
      margin: 15px 0;
    }

    blockquote {
      border-left: 3px solid #eee;
      padding-left: 0.75em;
      margin-bottom: 15px;
      color: #999;
      font-size: 0.9em;
    }
  `)
}
169785
function convertConfig(config) {
    let {colors, prev = '', output, src = 'css/rsuite.min.css'} =config;
    return Object.keys(colors).map(key => {
        return {
            baseColor: colors[key],
            src,
            dist: Path.join(output, `${prev}${key}${Path.extname(src)}`)
        }
    });
}
756021
protected function buildCssWithSass(array $config)
    {
        $bootstrapFile = $config['assets_dir'].'/stylesheets/_bootstrap.scss';
        if (true === isset($config['customize']['variables_file']) &&
            null !== $config['customize']['variables_file']) {
            $bootstrapFile = $config['customize']['bootstrap_output'];
        }

        $inputs = array(
            $bootstrapFile,
            __DIR__.'/../Resources/sass/form.scss'
        );
        if ('fa' === $config['icon_prefix']) {
            $inputs[] = $config['fontawesome_dir'].'/scss/font-awesome.scss';
        }

        return array(
            'inputs'  => $inputs,
            'filters' => array($config['css_preprocessor']),
            'output'  => $config['output_dir'].'css/bootstrap.css'
        );
    }
749394
public function saveOptions($config = null)
    {
        if ($config === null) {
            return $this->getConfig('saveOptions');
        }

        return $this->setConfig('saveOptions', $config);
    }
725317
function saveToFile(filename, cfg) {
  // Use 'wx' flag to fails if filename exists
  fs.writeFileSync(filename, JSON.stringify(cfg, null, 2), {flag: 'wx'})
}