dbgov-cli 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/install.js +9 -5
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -33,8 +33,12 @@ function isAllowedRedirectHost(urlStr) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function envWithDeprecatedAlias(primary, deprecatedName) {
|
|
37
|
+
return process.env[primary] || process.env[deprecatedName] || '';
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
function applyMirror(canonicalUrl) {
|
|
37
|
-
const mirror =
|
|
41
|
+
const mirror = envWithDeprecatedAlias('DBGOV_DOWNLOAD_MIRROR', 'DBGOV_CLI_DOWNLOAD_MIRROR');
|
|
38
42
|
if (!mirror) return canonicalUrl;
|
|
39
43
|
return mirror.replace(/\/+$/, '') + '/' + canonicalUrl;
|
|
40
44
|
}
|
|
@@ -167,8 +171,8 @@ function parseChecksums(text) {
|
|
|
167
171
|
}
|
|
168
172
|
|
|
169
173
|
async function verifyDownloadedBinary(binaryPath, binaryName) {
|
|
170
|
-
if (
|
|
171
|
-
console.log('Verification skipped (
|
|
174
|
+
if (envWithDeprecatedAlias('DBGOV_SKIP_VERIFY', 'DBGOV_CLI_SKIP_VERIFY') === '1') {
|
|
175
|
+
console.log('Verification skipped (DBGOV_SKIP_VERIFY=1)');
|
|
172
176
|
return;
|
|
173
177
|
}
|
|
174
178
|
|
|
@@ -180,14 +184,14 @@ async function verifyDownloadedBinary(binaryPath, binaryName) {
|
|
|
180
184
|
} catch (err) {
|
|
181
185
|
throw new Error(
|
|
182
186
|
`Could not fetch canonical checksums.txt from ${checksumsUrl}: ${err.message}. ` +
|
|
183
|
-
'Set
|
|
187
|
+
'Set DBGOV_SKIP_VERIFY=1 to install without checksum verification.'
|
|
184
188
|
);
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
if (!checksums[binaryName]) {
|
|
188
192
|
throw new Error(
|
|
189
193
|
`No checksum found for ${binaryName}. ` +
|
|
190
|
-
'Set
|
|
194
|
+
'Set DBGOV_SKIP_VERIFY=1 to install without checksum verification.'
|
|
191
195
|
);
|
|
192
196
|
}
|
|
193
197
|
|