windows-autoconf
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -70,3 +70,3 @@ 'use strict' | ||
try { | ||
const setup = JSON.parse(ret || '[]') | ||
const setup = JSON.parse(ret) | ||
setup.log = log | ||
@@ -85,2 +85,3 @@ return setup | ||
function checkSetup (setups) { | ||
if (setups && setups[0] === 'No COM') return | ||
setups.sort((a, b) => a.Version.localeCompare(b.Version)).reverse() | ||
@@ -157,4 +158,3 @@ const setup = setups.find(s => s.MSBuild && s.VCTools && (s.SDK || s.SDK8)) | ||
if ('cache2017' in getVS2017Setup) return getVS2017Setup.cache2017 | ||
const vsSetupViaCom = tryVS2017Powershell() || tryVS2017CSC() | ||
const vsSetup = (vsSetupViaCom === 'No COM') ? tryVS2017Registry() : vsSetupViaCom | ||
const vsSetup = tryVS2017Powershell() || tryVS2017CSC() || tryVS2017Registry() | ||
getVS2017Setup.cache2017 = vsSetup | ||
@@ -161,0 +161,0 @@ return vsSetup |
{ | ||
"name": "windows-autoconf", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"description": "Try to find MS build tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,20 +15,23 @@ /* eslint-disable no-path-concat */ | ||
const prods = new Set(['BuildTools', 'Enterprise', 'Professional', 'Community']) | ||
function checkCom() { | ||
let ret | ||
try { | ||
ret = execSync(getter.check_VS2017_COM_path).toString() | ||
} catch (e) { | ||
console.error(e) | ||
assert.equal(e.status, 1) | ||
ret = e.output[1].toString().trim() | ||
assert.equal(ret, '"No COM"') | ||
} | ||
const setup = JSON.parse(ret) | ||
if (setup === 'No COM') { | ||
this.skip() | ||
} else { | ||
assert.equal(setup, 'COM Ok') | ||
} | ||
} | ||
describe('Try cmd tools', () => { | ||
describe('Try COM', () => { | ||
before(function () { | ||
let ret | ||
try { | ||
ret = execSync(getter.check_VS2017_COM_path).toString() | ||
} catch (e) { | ||
if (e.status === 1 && e.output[1].toString() === 'No COM') return this.skip() | ||
throw e | ||
} | ||
const setup = JSON.parse(ret) | ||
if (setup === 'No COM') { | ||
this.skip() | ||
} else { | ||
assert.equal(setup, 'COM Ok') | ||
} | ||
}) | ||
before(checkCom) | ||
@@ -112,17 +115,3 @@ it('Powershell', () => { | ||
describe('Try COM', () => { | ||
before(function () { | ||
let ret | ||
try { | ||
ret = execSync(getter.check_VS2017_COM_path).toString() | ||
} catch (e) { | ||
if (e.status === 1 && e.output[1].toString() === 'No COM') return this.skip() | ||
throw e | ||
} | ||
const setup = JSON.parse(ret) | ||
if (setup === 'No COM') { | ||
this.skip() | ||
} else { | ||
assert.equal(setup, 'COM Ok') | ||
} | ||
}) | ||
before(checkCom) | ||
@@ -129,0 +118,0 @@ it('Powershell', () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
41560
634