@@ -52,6 +52,7 @@ module.exports = {
52
52
let overwrite = this . readConfig ( 'overwrite' ) ;
53
53
let includeAppVersion = this . readConfig ( 'includeAppVersion' ) ;
54
54
let uploadMinifiedFile = this . readConfig ( 'uploadMinifiedFile' ) ;
55
+ let upload = this . readConfig ( '_upload' ) || request ;
55
56
56
57
log ( 'Uploading sourcemaps to bugsnag' , { verbose : true } ) ;
57
58
@@ -82,7 +83,7 @@ module.exports = {
82
83
formData . appVersion = revisionKey ;
83
84
}
84
85
85
- return request ( {
86
+ return upload ( {
86
87
uri : 'https://upload.bugsnag.com' ,
87
88
method : 'POST' ,
88
89
formData : formData
@@ -97,13 +98,14 @@ module.exports = {
97
98
didUpload ( ) {
98
99
this . log ( 'Deleting sourcemaps' , { verbose : true } ) ;
99
100
let deleteSourcemaps = this . readConfig ( 'deleteSourcemaps' ) ;
101
+ let deleteFile = this . readConfig ( '_deleteFile' ) || fs . unlink ;
100
102
if ( deleteSourcemaps ) {
101
103
let distDir = this . readConfig ( 'distDir' ) ;
102
104
let distFiles = this . readConfig ( 'distFiles' ) ;
103
105
let mapFilePaths = fetchFilePathsByType ( distFiles , distDir , 'map' ) ;
104
106
let promises = mapFilePaths . map ( function ( mapFilePath ) {
105
107
return new RSVP . Promise ( function ( resolve , reject ) {
106
- fs . unlink ( mapFilePath , function ( err ) {
108
+ deleteFile ( mapFilePath , function ( err ) {
107
109
if ( err ) {
108
110
reject ( ) ;
109
111
} else {
0 commit comments