@@ -52,6 +52,7 @@ module.exports = {
5252 let overwrite = this . readConfig ( 'overwrite' ) ;
5353 let includeAppVersion = this . readConfig ( 'includeAppVersion' ) ;
5454 let uploadMinifiedFile = this . readConfig ( 'uploadMinifiedFile' ) ;
55+ let upload = this . readConfig ( '_upload' ) || request ;
5556
5657 log ( 'Uploading sourcemaps to bugsnag' , { verbose : true } ) ;
5758
@@ -82,7 +83,7 @@ module.exports = {
8283 formData . appVersion = revisionKey ;
8384 }
8485
85- return request ( {
86+ return upload ( {
8687 uri : 'https://upload.bugsnag.com' ,
8788 method : 'POST' ,
8889 formData : formData
@@ -97,13 +98,14 @@ module.exports = {
9798 didUpload ( ) {
9899 this . log ( 'Deleting sourcemaps' , { verbose : true } ) ;
99100 let deleteSourcemaps = this . readConfig ( 'deleteSourcemaps' ) ;
101+ let deleteFile = this . readConfig ( '_deleteFile' ) || fs . unlink ;
100102 if ( deleteSourcemaps ) {
101103 let distDir = this . readConfig ( 'distDir' ) ;
102104 let distFiles = this . readConfig ( 'distFiles' ) ;
103105 let mapFilePaths = fetchFilePathsByType ( distFiles , distDir , 'map' ) ;
104106 let promises = mapFilePaths . map ( function ( mapFilePath ) {
105107 return new RSVP . Promise ( function ( resolve , reject ) {
106- fs . unlink ( mapFilePath , function ( err ) {
108+ deleteFile ( mapFilePath , function ( err ) {
107109 if ( err ) {
108110 reject ( ) ;
109111 } else {
0 commit comments