File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,27 @@ if (!output) {
95
95
}
96
96
97
97
fs . ensureDirSync ( destination ) ;
98
+
99
+ function writeFile ( file , content ) {
100
+ file = path . join ( destination , file ) ;
101
+ fs . writeFile ( file , content , function ( err ) {
102
+ if ( err ) {
103
+ console . log ( 'Failed to write ' + file + ': ' + err ) ;
104
+ }
105
+ } ) ;
106
+ }
107
+
98
108
for ( var contractName in output . contracts ) {
99
109
if ( argv . bin ) {
100
- fs . writeFileSync ( path . join ( destination , contractName + '.bin' ) , output . contracts [ contractName ] . bytecode ) ;
110
+ writeFile ( contractName + '.bin' , output . contracts [ contractName ] . bytecode ) ;
101
111
}
102
112
103
113
if ( argv . abi ) {
104
- fs . writeFileSync ( path . join ( destination , contractName + '.abi' ) , output . contracts [ contractName ] . interface ) ;
114
+ writeFile ( contractName + '.abi' , output . contracts [ contractName ] . interface ) ;
105
115
}
106
116
}
107
117
108
- originalUncaughtExceptionListeners . forEach ( function ( listener ) { process . addListener ( 'uncaughtException' , listener ) ; } ) ;
118
+ // Put back original exception handlers.
119
+ originalUncaughtExceptionListeners . forEach ( function ( listener ) {
120
+ process . addListener ( 'uncaughtException' , listener ) ;
121
+ } ) ;
You can’t perform that action at this time.
0 commit comments