Use -latest and -version properly

Fixes #8
This commit is contained in:
Heath Stewart
2020-04-04 10:47:46 -07:00
parent 2f9b9c17d6
commit 80d0deb83b
3 changed files with 8 additions and 12 deletions

View File

@ -15,11 +15,8 @@ const VSWHERE_PATH =
)
// if a specific version of VS is requested
let VSWHERE_EXEC =
'-products * -requires Microsoft.Component.MSBuild -property installationPath '
if (VS_VERSION === 'latest') {
VSWHERE_EXEC += '-latest '
} else {
let VSWHERE_EXEC = '-products * -requires Microsoft.Component.MSBuild -property installationPath -latest '
if (VS_VERSION !== 'latest') {
VSWHERE_EXEC += `-version "${VS_VERSION}" `
}