File tree Expand file tree Collapse file tree 3 files changed +27
-9
lines changed
Expand file tree Collapse file tree 3 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "DEBUG" : false ,
3+ "USE_PROXY" : false ,
4+ "PROXY_PORT" : 8888 ,
5+ "PROXY_HOSTNAME" : " 127.0.0.1" ,
6+ "TYPESCRIPT_COMPILER_OPTIONS" : {},
7+ "CI_LOGGER" : false
8+ }
Original file line number Diff line number Diff line change 44import path = require( "path" ) ;
55import util = require( "util" ) ;
66import staticConfigBaseLibPath = require( "./common/static-config-base" ) ;
7+ import configBaseLib = require( "./common/config-base" ) ;
78
8- $injector . register ( "config" , {
9- CI_LOGGER : false ,
10- DEBUG : process . env . NATIVESCRIPT_DEBUG ,
11- TYPESCRIPT_COMPILER_OPTIONS : { }
12- } ) ;
9+ export class Configuration extends configBaseLib . ConfigBase implements IConfiguration { // User specific config
10+ CI_LOGGER = false ;
11+ DEBUG = false ;
12+ TYPESCRIPT_COMPILER_OPTIONS = { } ;
13+ USE_PROXY = false ;
14+
15+ /*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/
16+ constructor ( protected $fs : IFileSystem ) {
17+ super ( $fs ) ;
18+ _ . extend ( this , this . loadConfig ( "config" ) . wait ( ) ) ;
19+ }
20+ }
21+ $injector . register ( "config" , Configuration ) ;
1322
1423export class StaticConfig extends staticConfigBaseLibPath . StaticConfigBase implements IStaticConfig {
1524 public PROJECT_FILE_NAME = ".tnsproject" ;
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ import Future = require("fibers/future");
88import errors = require( "./common/errors" ) ;
99errors . installUncaughtExceptionListener ( ) ;
1010
11- var config = < Config . IConfig > $injector . resolve ( "$config" ) ;
12- ( < IErrors > $injector . resolve ( "$errors" ) ) . printCallStack = config . DEBUG ;
13-
1411fiber ( ( ) => {
15- var commandDispatcher : ICommandDispatcher = $injector . resolve ( "commandDispatcher" ) ;
12+ var config = < Config . IConfig > $injector . resolve ( "$config" ) ;
13+ var err = < IErrors > $injector . resolve ( "$errors" ) ;
14+ err . printCallStack = config . DEBUG ;
15+
16+ var commandDispatcher : ICommandDispatcher = $injector . resolve ( "commandDispatcher" ) ;
1617
1718 if ( process . argv [ 2 ] === "completion" ) {
1819 commandDispatcher . completeCommand ( ) . wait ( ) ;
You can’t perform that action at this time.
0 commit comments