Skip to content

Commit e84720c

Browse files
committed
Added template option to .csscomb.js for css template file
1 parent 735749f commit e84720c

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

lib/cli.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,29 @@ if (fs.existsSync(configPath)) {
3434
} else {
3535
config = require(configPath);
3636
}
37-
comb = new Comb();
37+
38+
if (config.template) {
39+
if (fs.existsSync(config.template)) {
40+
comb = new Comb();
41+
comb.detect();
42+
var templateConfig = comb.processFile(config.template);
43+
for (var attrname in templateConfig) {
44+
if (!config[attrname]) {
45+
config[attrname] = templateConfig[attrname];
46+
}
47+
}
48+
} else {
49+
console.log('Template configuration file ' + config.template + ' was not found.');
50+
process.exit(1);
51+
}
52+
}
3853

3954
console.time('spent');
4055

4156
config.verbose = program.verbose === true || config.verbose;
4257
config.lint = program.lint;
4358

59+
comb = new Comb();
4460
comb.configure(config);
4561

4662
vow.all(program.args.map(comb.processPath.bind(comb)))

0 commit comments

Comments
 (0)