From 20e13038534238cc96776561fe614a91d912e200 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Tue, 21 Apr 2020 16:57:28 -0700 Subject: [PATCH] Fix tool lookup and revert logging --- dist/index.js | 12 ++++++------ src/main.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/index.js b/dist/index.js index 04709f7..f9150ed 100644 --- a/dist/index.js +++ b/dist/index.js @@ -996,20 +996,20 @@ function run() { let vswhereToolExe = ''; if (VSWHERE_PATH) { // specified a path for vswhere, use it - core.info(`Using given vswhere-path: ${VSWHERE_PATH}`); + core.debug(`Using given vswhere-path: ${VSWHERE_PATH}`); vswhereToolExe = path.join(VSWHERE_PATH, 'vswhere.exe'); } else { // check in PATH to see if it is there try { const vsWhereInPath = yield io.which('vswhere', true); - core.info(`Found tool in PATH: ${vsWhereInPath}`); - vswhereToolExe = path.join(vsWhereInPath, 'vswhere.exe'); + core.debug(`Found tool in PATH: ${vsWhereInPath}`); + vswhereToolExe = vsWhereInPath; } catch (_a) { // fall back to VS-installed path vswhereToolExe = path.join(process.env['ProgramFiles(x86)'], 'Microsoft Visual Studio\\Installer\\vswhere.exe'); - core.info(`Trying Visual Studio-installed path: ${vswhereToolExe}`); + core.debug(`Trying Visual Studio-installed path: ${vswhereToolExe}`); } } if (!fs.existsSync(vswhereToolExe)) { @@ -1022,7 +1022,7 @@ function run() { options.listeners = { stdout: (data) => { const installationPath = data.toString().trim(); - core.info(`Found installation path: ${installationPath}`); + core.debug(`Found installation path: ${installationPath}`); let toolPath = path.join(installationPath, 'MSBuild\\Current\\Bin\\MSBuild.exe'); core.debug(`Checking for path: ${toolPath}`); if (!fs.existsSync(toolPath)) { @@ -1047,7 +1047,7 @@ function run() { core.setOutput('msbuildPath', toolFolderPath); // add tool path to PATH core.addPath(toolFolderPath); - core.info(`Tool path added to PATH: ${toolFolderPath}`); + core.debug(`Tool path added to PATH: ${toolFolderPath}`); } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index a9f3d44..05035ca 100644 --- a/src/main.ts +++ b/src/main.ts @@ -30,21 +30,21 @@ async function run(): Promise { if (VSWHERE_PATH) { // specified a path for vswhere, use it - core.info(`Using given vswhere-path: ${VSWHERE_PATH}`) + core.debug(`Using given vswhere-path: ${VSWHERE_PATH}`) vswhereToolExe = path.join(VSWHERE_PATH, 'vswhere.exe') } else { // check in PATH to see if it is there try { const vsWhereInPath: string = await io.which('vswhere', true) - core.info(`Found tool in PATH: ${vsWhereInPath}`) - vswhereToolExe = path.join(vsWhereInPath, 'vswhere.exe') + core.debug(`Found tool in PATH: ${vsWhereInPath}`) + vswhereToolExe = vsWhereInPath } catch { // fall back to VS-installed path vswhereToolExe = path.join( process.env['ProgramFiles(x86)'] as string, 'Microsoft Visual Studio\\Installer\\vswhere.exe' ) - core.info(`Trying Visual Studio-installed path: ${vswhereToolExe}`) + core.debug(`Trying Visual Studio-installed path: ${vswhereToolExe}`) } } @@ -63,7 +63,7 @@ async function run(): Promise { options.listeners = { stdout: (data: Buffer) => { const installationPath = data.toString().trim() - core.info(`Found installation path: ${installationPath}`) + core.debug(`Found installation path: ${installationPath}`) let toolPath = path.join( installationPath, @@ -103,7 +103,7 @@ async function run(): Promise { // add tool path to PATH core.addPath(toolFolderPath) - core.info(`Tool path added to PATH: ${toolFolderPath}`) + core.debug(`Tool path added to PATH: ${toolFolderPath}`) } catch (error) { core.setFailed(error.message) }