Follow HTTP redirects when downloading the CMake installer [Fix #614]
This commit is contained in:
Родитель
358d8dc533
Коммит
7ac8606342
|
@ -978,7 +978,7 @@
|
|||
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||
"lint": "node ./node_modules/tslint/bin/tslint -p . --fix",
|
||||
"lint:nofix": "node ./node_modules/tslint/bin/tslint -p .",
|
||||
"docs": "node ./node_modules/typedoc/bin/typedoc --mode modules --excludeExternals --out build/docs/dev --readme none src/"
|
||||
"docs": "node ./node_modules/typedoc/bin/typedoc --mode modules --excludeExternals --out build/docs/dev --readme none src/ types/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ajv": "^0.0.3",
|
||||
|
@ -1001,13 +1001,14 @@
|
|||
"sinon": "~5.0.7",
|
||||
"ts-node": "^6.0.0",
|
||||
"tslint": "^5.9.1",
|
||||
"typedoc": "~0.11.1",
|
||||
"typescript": "~2.8.3",
|
||||
"typedoc": "~0.13.0",
|
||||
"typescript": "~3.2.2",
|
||||
"vscode": "1.1.21"
|
||||
},
|
||||
"dependencies": {
|
||||
"ajv": "^4.7.5",
|
||||
"es6-promisify": "~5.0.0",
|
||||
"follow-redirects": "^1.5.10",
|
||||
"iconv-lite": "^0.4.21",
|
||||
"js-yaml": "^3.6.1",
|
||||
"json5": "^0.5.1",
|
||||
|
|
|
@ -8,11 +8,13 @@ import paths from '@cmt/paths';
|
|||
import {execute} from '@cmt/proc';
|
||||
import rollbar from '@cmt/rollbar';
|
||||
import {InvalidVersionString, ProgressHandle, Version, versionLess, versionToString} from '@cmt/util';
|
||||
import {https} from 'follow-redirects';
|
||||
import * as fs from 'fs';
|
||||
import * as https from 'https';
|
||||
import * as url_mod from 'url';
|
||||
import * as path from 'path';
|
||||
import * as tmp from 'tmp';
|
||||
import * as vscode from 'vscode';
|
||||
import { ClientRequestArgs } from 'http';
|
||||
|
||||
const log = createLogger('cm-upgrade');
|
||||
|
||||
|
@ -40,8 +42,10 @@ async function downloadFile(url: string, opt: {prefix: string, postfix: string},
|
|||
return;
|
||||
}
|
||||
try {
|
||||
const ostream = fs.createWriteStream(fpath, {fd});
|
||||
const req = https.get(url, res => {
|
||||
const ostream = fs.createWriteStream(fpath, { fd });
|
||||
const reqOptions: ClientRequestArgs = url_mod.parse(url);
|
||||
(reqOptions as any).maxBodyLength = 1024 * 1024 * 60;
|
||||
const req = https.get(reqOptions, res => {
|
||||
if (res.statusCode !== 200) {
|
||||
reject(new Error('Non-200 response when downloading new CMake installer'));
|
||||
return;
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
"@test/*": ["test/*"]
|
||||
},
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
"node_modules/@types",
|
||||
"types/"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"rootDir": ".",
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
declare module 'follow-redirects' {
|
||||
declare const http: typeof import('http');
|
||||
declare const https: typeof import('https');
|
||||
}
|
122
yarn.lock
122
yarn.lock
|
@ -30,9 +30,10 @@
|
|||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86"
|
||||
|
||||
"@types/fs-extra@5.0.1":
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.1.tgz#cd856fbbdd6af2c11f26f8928fd8644c9e9616c9"
|
||||
"@types/fs-extra@^5.0.3":
|
||||
version "5.0.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599"
|
||||
integrity sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
|
@ -44,13 +45,15 @@
|
|||
"@types/minimatch" "*"
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/handlebars@4.0.36":
|
||||
version "4.0.36"
|
||||
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.36.tgz#ff57c77fa1ab6713bb446534ddc4d979707a3a79"
|
||||
"@types/handlebars@^4.0.38":
|
||||
version "4.0.39"
|
||||
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.39.tgz#961fb54db68030890942e6aeffe9f93a957807bd"
|
||||
integrity sha512-vjaS7Q0dVqFp85QhyPSZqDKnTTCemcSHNHFvDdalO1s0Ifz5KuE64jQD5xoUkfdWwF4WpqdJEl7LsWH8rzhKJA==
|
||||
|
||||
"@types/highlight.js@9.12.2":
|
||||
version "9.12.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.2.tgz#6ee7cd395effe5ec80b515d3ff1699068cd0cd1d"
|
||||
"@types/highlight.js@^9.12.3":
|
||||
version "9.12.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.3.tgz#b672cfaac25cbbc634a0fd92c515f66faa18dbca"
|
||||
integrity sha512-pGF/zvYOACZ/gLGWdQH8zSwteQS1epp68yRcVLJMgUck/MjEn/FBYmPub9pXT8C1e4a8YZfHo1CKyV8q1vKUnQ==
|
||||
|
||||
"@types/js-yaml@^3.5.28":
|
||||
version "3.11.1"
|
||||
|
@ -60,13 +63,15 @@
|
|||
version "0.0.29"
|
||||
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
|
||||
|
||||
"@types/lodash@4.14.104":
|
||||
version "4.14.104"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80"
|
||||
"@types/lodash@^4.14.110":
|
||||
version "4.14.119"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.119.tgz#be847e5f4bc3e35e46d041c394ead8b603ad8b39"
|
||||
integrity sha512-Z3TNyBL8Vd/M9D9Ms2S3LmFq2sSMzahodD6rCS9V2N44HUMINb75jNkSuwAx7eo2ufqTdfOdtGQpNbieUjPQmw==
|
||||
|
||||
"@types/marked@0.3.0":
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.3.0.tgz#583c223dd33385a1dda01aaf77b0cd0411c4b524"
|
||||
"@types/marked@^0.4.0":
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.2.tgz#64a89e53ea37f61cc0f3ee1732c555c2dbf6452f"
|
||||
integrity sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg==
|
||||
|
||||
"@types/minimatch@*", "@types/minimatch@3.0.3":
|
||||
version "3.0.3"
|
||||
|
@ -89,9 +94,10 @@
|
|||
version "0.0.28"
|
||||
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-0.0.28.tgz#5562519bc7963caca8abf7f128cae3b594d41d06"
|
||||
|
||||
"@types/shelljs@0.7.8":
|
||||
version "0.7.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.8.tgz#4b4d6ee7926e58d7bca448a50ba442fd9f6715bd"
|
||||
"@types/shelljs@^0.8.0":
|
||||
version "0.8.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.8.1.tgz#133e874b5fb816a2e1c8647839c82d76760b1191"
|
||||
integrity sha512-1lQw+48BuVgp6c1+z8EMipp18IdnV2dLh6KQGwOm+kJy9nPjEkaqRKmwbDNEYf//EKBvKcwOC6V2cDrNxVoQeQ==
|
||||
dependencies:
|
||||
"@types/glob" "*"
|
||||
"@types/node" "*"
|
||||
|
@ -498,7 +504,7 @@ debug@2.6.9:
|
|||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@3.1.0:
|
||||
debug@3.1.0, debug@=3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||
dependencies:
|
||||
|
@ -691,6 +697,13 @@ first-chunk-stream@^1.0.0:
|
|||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e"
|
||||
|
||||
follow-redirects@^1.5.10:
|
||||
version "1.5.10"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
|
||||
integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==
|
||||
dependencies:
|
||||
debug "=3.1.0"
|
||||
|
||||
for-in@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
|
||||
|
@ -717,9 +730,10 @@ from@~0:
|
|||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
|
||||
|
||||
fs-extra@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd"
|
||||
fs-extra@^7.0.0:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
|
||||
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
|
||||
dependencies:
|
||||
graceful-fs "^4.1.2"
|
||||
jsonfile "^4.0.0"
|
||||
|
@ -1241,9 +1255,10 @@ lodash.keys@^3.0.0:
|
|||
lodash.isarguments "^3.0.0"
|
||||
lodash.isarray "^3.0.0"
|
||||
|
||||
lodash@^4.17.5:
|
||||
version "4.17.10"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
|
||||
lodash@^4.17.10:
|
||||
version "4.17.11"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|
||||
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
|
||||
|
||||
lolex@^2.2.0, lolex@^2.3.2:
|
||||
version "2.4.1"
|
||||
|
@ -1265,9 +1280,10 @@ map-stream@~0.1.0:
|
|||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194"
|
||||
|
||||
marked@^0.3.17:
|
||||
version "0.3.19"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
|
||||
marked@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-0.4.0.tgz#9ad2c2a7a1791f10a852e0112f77b571dce10c66"
|
||||
integrity sha512-tMsdNBgOsrUophCAFQl0XPe6Zqk/uy9gnue+jIIKhykO51hxyu6uNx7zBPy0+y/WKYVZZMspV9YeXLNdKk+iYw==
|
||||
|
||||
math-random@^1.0.1:
|
||||
version "1.0.1"
|
||||
|
@ -1691,9 +1707,10 @@ semver@^5.3.0, semver@^5.4.1:
|
|||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
shelljs@^0.8.1:
|
||||
version "0.8.2"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35"
|
||||
shelljs@^0.8.2:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097"
|
||||
integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==
|
||||
dependencies:
|
||||
glob "^7.0.0"
|
||||
interpret "^1.0.0"
|
||||
|
@ -1962,35 +1979,38 @@ typedoc-default-themes@^0.5.0:
|
|||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227"
|
||||
|
||||
typedoc@~0.11.1:
|
||||
version "0.11.1"
|
||||
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.11.1.tgz#9f033887fd2218c769e1045feb88a1efed9f12c9"
|
||||
typedoc@~0.13.0:
|
||||
version "0.13.0"
|
||||
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.13.0.tgz#9efdf352bd54873955cd161bd4b75f24a8c59dde"
|
||||
integrity sha512-jQWtvPcV+0fiLZAXFEe70v5gqjDO6pJYJz4mlTtmGJeW2KRoIU/BEfktma6Uj8Xii7UakuZjbxFewl3UYOkU/w==
|
||||
dependencies:
|
||||
"@types/fs-extra" "5.0.1"
|
||||
"@types/handlebars" "4.0.36"
|
||||
"@types/highlight.js" "9.12.2"
|
||||
"@types/lodash" "4.14.104"
|
||||
"@types/marked" "0.3.0"
|
||||
"@types/fs-extra" "^5.0.3"
|
||||
"@types/handlebars" "^4.0.38"
|
||||
"@types/highlight.js" "^9.12.3"
|
||||
"@types/lodash" "^4.14.110"
|
||||
"@types/marked" "^0.4.0"
|
||||
"@types/minimatch" "3.0.3"
|
||||
"@types/shelljs" "0.7.8"
|
||||
fs-extra "^5.0.0"
|
||||
"@types/shelljs" "^0.8.0"
|
||||
fs-extra "^7.0.0"
|
||||
handlebars "^4.0.6"
|
||||
highlight.js "^9.0.0"
|
||||
lodash "^4.17.5"
|
||||
marked "^0.3.17"
|
||||
lodash "^4.17.10"
|
||||
marked "^0.4.0"
|
||||
minimatch "^3.0.0"
|
||||
progress "^2.0.0"
|
||||
shelljs "^0.8.1"
|
||||
shelljs "^0.8.2"
|
||||
typedoc-default-themes "^0.5.0"
|
||||
typescript "2.7.2"
|
||||
typescript "3.1.x"
|
||||
|
||||
typescript@2.7.2:
|
||||
version "2.7.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
|
||||
typescript@3.1.x:
|
||||
version "3.1.6"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68"
|
||||
integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==
|
||||
|
||||
typescript@~2.8.3:
|
||||
version "2.8.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
|
||||
typescript@~3.2.2:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5"
|
||||
integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==
|
||||
|
||||
uglify-js@^2.6:
|
||||
version "2.8.29"
|
||||
|
|
Загрузка…
Ссылка в новой задаче