File tree Expand file tree Collapse file tree 3 files changed +26
-5
lines changed Expand file tree Collapse file tree 3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 22
33var path = require ( 'path' ) ;
44var fs = require ( 'fs' ) ;
5- var lib = path . join ( path . dirname ( fs . realpathSync ( __filename ) ) , '../lib' ) ;
65
7- require ( lib + '/coffeescript/cake' ) . run ( ) ;
6+ var potentialPaths = [
7+ path . join ( process . cwd ( ) , 'node_modules/coffeescript/lib/coffeescript' ) ,
8+ path . join ( process . cwd ( ) , 'node_modules/coffeescript/lib/coffee-script' ) ,
9+ path . join ( process . cwd ( ) , 'node_modules/coffee-script/lib/coffee-script' ) ,
10+ path . join ( __dirname , '../lib/coffeescript' )
11+ ] ;
12+
13+ for ( var i = 0 , len = potentialPaths . length ; i < len ; i ++ ) {
14+ if ( fs . existsSync ( potentialPaths [ i ] ) ) {
15+ require ( potentialPaths [ i ] + '/cake' ) . run ( ) ;
16+ break ;
17+ }
18+ }
Original file line number Diff line number Diff line change 22
33var path = require ( 'path' ) ;
44var fs = require ( 'fs' ) ;
5- var lib = path . join ( path . dirname ( fs . realpathSync ( __filename ) ) , '../lib' ) ;
65
7- require ( lib + '/coffeescript/command' ) . run ( ) ;
6+ var potentialPaths = [
7+ path . join ( process . cwd ( ) , 'node_modules/coffeescript/lib/coffeescript' ) ,
8+ path . join ( process . cwd ( ) , 'node_modules/coffeescript/lib/coffee-script' ) ,
9+ path . join ( process . cwd ( ) , 'node_modules/coffee-script/lib/coffee-script' ) ,
10+ path . join ( __dirname , '../lib/coffeescript' )
11+ ] ;
12+
13+ for ( var i = 0 , len = potentialPaths . length ; i < len ; i ++ ) {
14+ if ( fs . existsSync ( potentialPaths [ i ] ) ) {
15+ require ( potentialPaths [ i ] + '/command' ) . run ( ) ;
16+ break ;
17+ }
18+ }
Original file line number Diff line number Diff line change 2727 " register.js" ,
2828 " repl.js"
2929 ],
30- "preferGlobal" : true ,
3130 "scripts" : {
3231 "test" : " node ./bin/cake test" ,
3332 "test-harmony" : " node --harmony ./bin/cake test"
You can’t perform that action at this time.
0 commit comments