File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/oc-azure-storage-adapter Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -91,14 +91,16 @@ module.exports = function (conf) {
9191 return callback ( err ) ;
9292 }
9393
94+ let parsed = null ;
9495 try {
95- callback ( null , JSON . parse ( file ) ) ;
96+ parsed = JSON . parse ( file ) ;
9697 } catch ( er ) {
9798 return callback ( {
9899 code : strings . errors . STORAGE . FILE_NOT_VALID_CODE ,
99100 msg : format ( strings . errors . STORAGE . FILE_NOT_VALID , filePath )
100101 } ) ;
101102 }
103+ callback ( null , parsed ) ;
102104 } ) ;
103105 } ;
104106
@@ -272,12 +274,14 @@ module.exports = function (conf) {
272274 } ;
273275
274276 const putFile = ( filePath , fileName , isPrivate , callback ) => {
277+ let stream = null ;
275278 try {
276- const stream = fs . createReadStream ( filePath ) ;
277- return putFileContent ( stream , fileName , isPrivate , callback ) ;
279+ stream = fs . createReadStream ( filePath ) ;
278280 } catch ( e ) {
281+ console . log ( 'putfile error!' , e ) ;
279282 return callback ( e ) ;
280283 }
284+ return putFileContent ( stream , fileName , isPrivate , callback ) ;
281285 } ;
282286
283287 return {
You can’t perform that action at this time.
0 commit comments