@@ -6,6 +6,8 @@ import TruffleError from "@truffle/error";
6
6
import originalRequire from "original-require" ;
7
7
import { getInitialConfig , configProps } from "./configDefaults" ;
8
8
import { EventManager } from "@truffle/events" ;
9
+ import debugModule from "debug" ;
10
+ const debug = debugModule ( "config" ) ;
9
11
10
12
const DEFAULT_CONFIG_FILENAME = "truffle-config.js" ;
11
13
const BACKUP_CONFIG_FILENAME = "truffle.js" ; // old config filename
@@ -116,6 +118,7 @@ class TruffleConfig {
116
118
if ( typeof clone [ key ] === "object" && this . _deepCopy . includes ( key ) ) {
117
119
this [ key ] = merge ( this [ key ] , clone [ key ] ) ;
118
120
} else {
121
+ debug ( "setting key -- %o -- to -- %o" , key , clone [ key ] ) ;
119
122
this [ key ] = clone [ key ] ;
120
123
}
121
124
} catch ( e ) {
@@ -161,6 +164,7 @@ class TruffleConfig {
161
164
}
162
165
163
166
public static detect ( options : any = { } , filename ?: string ) : TruffleConfig {
167
+ debug ( "callling Config.detect with filename -- %o" , filename ) ;
164
168
let configFile ;
165
169
const configPath = options . config ;
166
170
@@ -180,13 +184,15 @@ class TruffleConfig {
180
184
}
181
185
182
186
public static load ( file : string , options : any = { } ) : TruffleConfig {
187
+ debug ( "calling Config.load with file -- %o" , file ) ;
183
188
const workingDirectory = options . config
184
189
? process . cwd ( )
185
190
: path . dirname ( path . resolve ( file ) ) ;
186
191
187
192
const config = new TruffleConfig ( undefined , workingDirectory , undefined ) ;
188
193
189
194
const staticConfig = originalRequire ( file ) ;
195
+ debug ( "the static config is -- %o" , staticConfig ) ;
190
196
191
197
config . merge ( staticConfig ) ;
192
198
config . merge ( options ) ;
0 commit comments