1
+ import debug from 'debug' ;
1
2
import * as path from 'path' ;
2
3
3
4
import { getArtifactFileName , getArtifactRemoteURL , FileNameUse } from './artifact-utils' ;
@@ -8,6 +9,7 @@ import { withTempDirectory, normalizeVersion, getHostArch, ensureIsTruthyString
8
9
9
10
export { getHostArch } from './utils' ;
10
11
12
+ const d = debug ( '@electron/get:index' ) ;
11
13
const sumchecker : typeof import ( 'sumchecker' ) . default = require ( 'sumchecker' ) ;
12
14
13
15
/**
@@ -47,9 +49,13 @@ export async function downloadArtifact(_artifactDetails: ElectronArtifactDetails
47
49
48
50
// Do not check if the file exists in the cache when force === true
49
51
if ( ! artifactDetails . force ) {
52
+ d ( `Checking the cache for ${ fileName } ` ) ;
50
53
const cachedPath = await cache . getPathForFileInCache ( fileName ) ;
51
54
52
- if ( cachedPath !== null ) {
55
+ if ( cachedPath === null ) {
56
+ d ( 'Cache miss' ) ;
57
+ } else {
58
+ d ( 'Cache hit' ) ;
53
59
return cachedPath ;
54
60
}
55
61
}
@@ -61,11 +67,13 @@ export async function downloadArtifact(_artifactDetails: ElectronArtifactDetails
61
67
) ;
62
68
63
69
const downloader = artifactDetails . downloader || ( await getDownloaderForSystem ( ) ) ;
64
- await downloader . download (
65
- getArtifactRemoteURL ( artifactDetails ) ,
66
- tempDownloadPath ,
67
- artifactDetails . downloadOptions ,
70
+ const url = getArtifactRemoteURL ( artifactDetails ) ;
71
+ d (
72
+ `Downloading ${ url } to ${ tempDownloadPath } with options: ${ JSON . stringify (
73
+ artifactDetails . downloadOptions ,
74
+ ) } `,
68
75
) ;
76
+ await downloader . download ( url , tempDownloadPath , artifactDetails . downloadOptions ) ;
69
77
70
78
// Don't try to verify the hash of the hash file itself
71
79
if (
0 commit comments