зеркало из https://github.com/electron/get.git
always overwrite
This commit is contained in:
Родитель
4fae03a9e5
Коммит
fcb7e39b27
14
src/Cache.ts
14
src/Cache.ts
|
@ -39,20 +39,10 @@ export class Cache {
|
|||
return null;
|
||||
}
|
||||
|
||||
public async putFileInCache(
|
||||
url: string,
|
||||
currentPath: string,
|
||||
fileName: string,
|
||||
overwrite?: boolean,
|
||||
): Promise<string> {
|
||||
public async putFileInCache(url: string, currentPath: string, fileName: string): Promise<string> {
|
||||
const cachePath = this.getCachePath(url, fileName);
|
||||
d(`Moving ${currentPath} to ${cachePath}`);
|
||||
if (await fs.pathExists(cachePath)) {
|
||||
d('* Replacing existing file');
|
||||
await fs.remove(cachePath);
|
||||
}
|
||||
|
||||
await fs.move(currentPath, cachePath, { overwrite });
|
||||
await fs.move(currentPath, cachePath, { overwrite: true });
|
||||
|
||||
return cachePath;
|
||||
}
|
||||
|
|
|
@ -180,12 +180,7 @@ export async function downloadArtifact(
|
|||
|
||||
await validateArtifact(details, tempDownloadPath, downloadArtifact);
|
||||
|
||||
return await cache.putFileInCache(
|
||||
url,
|
||||
tempDownloadPath,
|
||||
fileName,
|
||||
details.artifactName.startsWith('SHASUMS256'), // overwrite the SHASUMS in the cache
|
||||
);
|
||||
return await cache.putFileInCache(url, tempDownloadPath, fileName);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче