@prisma/fetch-engine
Advanced tools
Comparing version
@@ -15,2 +15,4 @@ import { Platform } from '@prisma/get-platform'; | ||
failSilent?: boolean; | ||
ignoreCache?: boolean; | ||
printVersion?: boolean; | ||
} | ||
@@ -17,0 +19,0 @@ export declare type BinaryPaths = { |
@@ -24,2 +24,3 @@ "use strict"; | ||
const flatMap_1 = require("./flatMap"); | ||
const getLatestAlphaTag_1 = require("./getLatestAlphaTag"); | ||
const debug = debug_1.default('download'); | ||
@@ -66,2 +67,8 @@ const writeFile = util_1.promisify(fs_1.default.writeFile); | ||
})); | ||
if (options.version === 'latest') { | ||
options.version = await getLatestAlphaTag_1.getLatestAlphaTag(); | ||
} | ||
if (options.printVersion) { | ||
console.log(`version: ${options.version}`); | ||
} | ||
// filter out files, which don't yet exist or have to be created | ||
@@ -71,3 +78,3 @@ const binariesToDownload = await p_filter_1.default(binaryJobs, async (job) => { | ||
debug({ needsToBeDownloaded }); | ||
return !job.envVarPath && needsToBeDownloaded; | ||
return !job.envVarPath && (options.ignoreCache || needsToBeDownloaded); | ||
}); | ||
@@ -266,3 +273,5 @@ if (binariesToDownload.length > 0) { | ||
} | ||
chmod_1.default(targetFilePath); | ||
if (process.platform !== 'win32') { | ||
chmod_1.default(targetFilePath); | ||
} | ||
// Cache result | ||
@@ -269,0 +278,0 @@ await saveFileToCache(options, version, lastModified); |
{ | ||
"name": "@prisma/fetch-engine", | ||
"version": "0.3.59", | ||
"version": "0.3.60", | ||
"main": "dist/index.js", | ||
@@ -11,3 +11,3 @@ "types": "dist/index.d.ts", | ||
"@types/jest": "^25.1.2", | ||
"@types/node": "^12.12.25", | ||
"@types/node": "^12.12.29", | ||
"@types/node-fetch": "^2.5.4", | ||
@@ -20,6 +20,6 @@ "@types/progress": "^2.0.3", | ||
"ts-jest": "^25.2.1", | ||
"typescript": "^3.8.2" | ||
"typescript": "^3.8.3" | ||
}, | ||
"dependencies": { | ||
"@prisma/get-platform": "0.1.29", | ||
"@prisma/get-platform": "0.1.23", | ||
"chalk": "^3.0.0", | ||
@@ -26,0 +26,0 @@ "debug": "^4.1.1", |
Sorry, the diff of this file is not supported yet
67859
1.01%1012
1.1%+ Added
- Removed
Updated