File tree Expand file tree Collapse file tree 7 files changed +28
-19
lines changed Expand file tree Collapse file tree 7 files changed +28
-19
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,15 @@ const run = conf => {
18
18
case 'tarball' :
19
19
if ( ! conf . _ [ 2 ] || conf . _ [ 2 ] === '-' ) {
20
20
return pacote . tarball . stream ( conf . _ [ 1 ] , stream => {
21
- stream . pipe ( conf . testStdout ||
22
- /* istanbul ignore next */ process . stdout )
21
+ stream . pipe (
22
+ conf . testStdout ||
23
+ /* istanbul ignore next */
24
+ process . stdout
25
+ )
23
26
// make sure it resolves something falsey
24
- return stream . promise ( ) . then ( ( ) => { } )
27
+ return stream . promise ( ) . then ( ( ) => {
28
+ return false
29
+ } )
25
30
} , conf )
26
31
} else {
27
32
return pacote . tarball . file ( conf . _ [ 1 ] , conf . _ [ 2 ] , conf )
Original file line number Diff line number Diff line change @@ -254,6 +254,7 @@ class FetcherBase {
254
254
cstream . on ( 'error' , err => stream . emit ( 'error' , err ) )
255
255
stream . pipe ( cstream )
256
256
257
+ // eslint-disable-next-line promise/catch-or-return
257
258
cstream . promise ( ) . catch ( ( ) => { } ) . then ( ( ) => middleStream . end ( ) )
258
259
return middleStream
259
260
}
@@ -269,7 +270,10 @@ class FetcherBase {
269
270
}
270
271
271
272
// override the types getter
272
- get types ( ) { }
273
+ get types ( ) {
274
+ return false
275
+ }
276
+
273
277
[ _assertType ] ( ) {
274
278
if ( this . types && ! this . types . includes ( this . spec . type ) ) {
275
279
throw new TypeError ( `Wrong spec type (${
Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ class GitFetcher extends Fetcher {
239
239
tarballOk = tarballOk &&
240
240
h && resolved === repoUrl ( h , { noCommittish : false } ) && h . tarball
241
241
242
- return cacache . tmp . withTmp ( this . cache , o , tmp => {
242
+ return cacache . tmp . withTmp ( this . cache , o , async tmp => {
243
243
// if we're resolved, and have a tarball url, shell out to RemoteFetcher
244
244
if ( tarballOk ) {
245
245
const nameat = this . spec . name ? `${ this . spec . name } @` : ''
@@ -259,16 +259,15 @@ class GitFetcher extends Fetcher {
259
259
} )
260
260
}
261
261
262
- return (
262
+ const sha = await (
263
263
h ? this [ _cloneHosted ] ( ref , tmp )
264
264
: this [ _cloneRepo ] ( this . spec . fetchSpec , ref , tmp )
265
- ) . then ( sha => {
266
- this . resolvedSha = sha
267
- if ( ! this . resolved ) {
268
- this [ _addGitSha ] ( sha )
269
- }
270
- } )
271
- . then ( ( ) => handler ( tmp ) )
265
+ )
266
+ this . resolvedSha = sha
267
+ if ( ! this . resolved ) {
268
+ await this [ _addGitSha ] ( sha )
269
+ }
270
+ return handler ( tmp )
272
271
} )
273
272
}
274
273
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class RemoteFetcher extends Fetcher {
41
41
algorithms : [ this . pickIntegrityAlgorithm ( ) ] ,
42
42
}
43
43
44
+ // eslint-disable-next-line promise/always-return
44
45
fetch ( this . resolved , fetchOpts ) . then ( res => {
45
46
res . body . on ( 'error' ,
46
47
/* istanbul ignore next - exceedingly rare and hard to simulate */
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " pacote" ,
3
- "version" : " 13.6.1 " ,
3
+ "version" : " 13.6.2 " ,
4
4
"description" : " JavaScript package downloader" ,
5
5
"author" : " GitHub Inc." ,
6
6
"bin" : {
Original file line number Diff line number Diff line change 140
140
"npmlog" : " ^6.0.2" ,
141
141
"opener" : " ^1.5.2" ,
142
142
"p-map" : " ^4.0.0" ,
143
- "pacote" : " ^13.6.1 " ,
143
+ "pacote" : " ^13.6.2 " ,
144
144
"parse-conflict-json" : " ^2.0.2" ,
145
145
"proc-log" : " ^2.0.1" ,
146
146
"qrcode-terminal" : " ^0.12.0" ,
5598
5598
}
5599
5599
},
5600
5600
"node_modules/pacote" : {
5601
- "version" : " 13.6.1 " ,
5602
- "resolved" : " https://registry.npmjs.org/pacote/-/pacote-13.6.1 .tgz" ,
5603
- "integrity" : " sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw ==" ,
5601
+ "version" : " 13.6.2 " ,
5602
+ "resolved" : " https://registry.npmjs.org/pacote/-/pacote-13.6.2 .tgz" ,
5603
+ "integrity" : " sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg ==" ,
5604
5604
"inBundle" : true ,
5605
5605
"dependencies" : {
5606
5606
"@npmcli/git" : " ^3.0.0" ,
Original file line number Diff line number Diff line change 108
108
"npmlog" : " ^6.0.2" ,
109
109
"opener" : " ^1.5.2" ,
110
110
"p-map" : " ^4.0.0" ,
111
- "pacote" : " ^13.6.1 " ,
111
+ "pacote" : " ^13.6.2 " ,
112
112
"parse-conflict-json" : " ^2.0.2" ,
113
113
"proc-log" : " ^2.0.1" ,
114
114
"qrcode-terminal" : " ^0.12.0" ,
You can’t perform that action at this time.
0 commit comments