File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,8 +25,16 @@ if (!program.args.length) {
2525var configPath = program . config || ( process . cwd ( ) + '/.csscomb.json' ) ;
2626
2727if ( fs . existsSync ( configPath ) ) {
28- var comb = new Comb ( ) ;
29- var config = require ( configPath ) ;
28+ var comb ;
29+ var config ;
30+ if ( configPath . match ( / \. c s s $ / ) ) {
31+ comb = new Comb ( ) ;
32+ comb . detect ( ) ;
33+ config = comb . processFile ( configPath ) ;
34+ } else {
35+ config = require ( configPath ) ;
36+ }
37+ comb = new Comb ( ) ;
3038
3139 console . time ( 'spent' ) ;
3240
Original file line number Diff line number Diff line change 11var gonzales = require ( 'gonzales-pe' ) ;
22var minimatch = require ( 'minimatch' ) ;
33var vow = require ( 'vow' ) ;
4+ var fs = require ( 'fs' ) ;
45var vfs = require ( 'vow-fs' ) ;
56var doNothing = function ( ) { } ;
67
@@ -173,6 +174,9 @@ Comb.prototype = {
173174 */
174175 processFile : function ( path ) {
175176 var _this = this ;
177+ if ( _this . _detect ) {
178+ return _this . processString ( fs . readFileSync ( path , 'utf8' ) , path ) ;
179+ }
176180 if ( this . _shouldProcessFile ( path ) ) {
177181 return vfs . read ( path , 'utf8' ) . then ( function ( data ) {
178182 var syntax = path . split ( '.' ) . pop ( ) ;
You can’t perform that action at this time.
0 commit comments