File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,11 @@ class Lifecycle extends EventEmitter {
98
98
let msg = ''
99
99
const length = ctx . output . length
100
100
for ( let i = 0 ; i < length ; i ++ ) {
101
- msg += handleUrlEncode ( ctx . output [ i ] . imgUrl )
102
- if ( i !== length - 1 ) {
103
- msg += '\n'
101
+ if ( typeof ctx . output [ i ] . imgUrl !== 'undefined' ) {
102
+ msg += handleUrlEncode ( ctx . output [ i ] . imgUrl ! )
103
+ if ( i !== length - 1 ) {
104
+ msg += '\n'
105
+ }
104
106
}
105
107
delete ctx . output [ i ] . base64Image
106
108
delete ctx . output [ i ] . buffer
Original file line number Diff line number Diff line change @@ -197,17 +197,17 @@ class PicGo extends EventEmitter implements IPicGo {
197
197
fs . remove ( imgPath ) . catch ( ( e ) => { this . log . error ( e ) } )
198
198
}
199
199
} )
200
- await this . lifecycle . start ( [ imgPath ] )
201
- return this . output
200
+ const { output } = await this . lifecycle . start ( [ imgPath ] )
201
+ return output
202
202
}
203
203
} catch ( e ) {
204
204
this . emit ( IBuildInEvent . FAILED , e )
205
205
throw e
206
206
}
207
207
} else {
208
208
// upload from path
209
- await this . lifecycle . start ( input )
210
- return this . output
209
+ const { output } = await this . lifecycle . start ( input )
210
+ return output
211
211
}
212
212
}
213
213
}
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ interface IImgInfo {
173
173
width ?: number
174
174
height ?: number
175
175
extname ?: string
176
+ imgUrl ?: string
176
177
[ propName : string ] : any
177
178
}
178
179
You can’t perform that action at this time.
0 commit comments