mirror of
https://github.com/microsoft/setup-msbuild.git
synced 2024-11-10 05:51:07 +07:00
Changing env process and fixing quoting
This commit is contained in:
parent
6fdb4e0384
commit
9fa19eb771
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -977,7 +977,7 @@ const io = __importStar(__webpack_require__(1));
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
const VS_VERSION = core.getInput('vs-version') || 'latest';
|
||||
const VSWHERE_PATH = core.getInput('vswhere-path') ||
|
||||
'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer';
|
||||
path.join(process.env['ProgramFiles(x86)'], 'Microsoft Visual Studio\\Installer');
|
||||
// if a specific version of VS is requested
|
||||
let VSWHERE_EXEC = '';
|
||||
if (VS_VERSION === 'latest') {
|
||||
@ -1017,7 +1017,7 @@ function run() {
|
||||
core.setFailed('setup-msbuild requires the path to where vswhere.exe exists');
|
||||
}
|
||||
}
|
||||
core.debug(`Full cached tool exe: ${vswhereToolExe}`);
|
||||
core.debug(`Full tool exe: ${vswhereToolExe}`);
|
||||
let foundToolPath = '';
|
||||
const options = {};
|
||||
options.listeners = {
|
||||
@ -1028,7 +1028,7 @@ function run() {
|
||||
}
|
||||
};
|
||||
// execute the find putting the result of the command in the options foundToolPath
|
||||
yield exec.exec(`${vswhereToolExe} ${VSWHERE_EXEC}`, [], options);
|
||||
yield exec.exec(`"${vswhereToolExe}" ${VSWHERE_EXEC}`, [], options);
|
||||
if (!foundToolPath) {
|
||||
core.setFailed('Unable to find msbuild.');
|
||||
return;
|
||||
|
@ -8,7 +8,10 @@ const IS_WINDOWS = process.platform === 'win32'
|
||||
const VS_VERSION = core.getInput('vs-version') || 'latest'
|
||||
const VSWHERE_PATH =
|
||||
core.getInput('vswhere-path') ||
|
||||
'C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer'
|
||||
path.join(
|
||||
process.env['ProgramFiles(x86)'] as string,
|
||||
'Microsoft Visual Studio\\Installer'
|
||||
)
|
||||
|
||||
// if a specific version of VS is requested
|
||||
let VSWHERE_EXEC = ''
|
||||
@ -51,7 +54,7 @@ async function run(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
core.debug(`Full cached tool exe: ${vswhereToolExe}`)
|
||||
core.debug(`Full tool exe: ${vswhereToolExe}`)
|
||||
|
||||
let foundToolPath = ''
|
||||
const options: ExecOptions = {}
|
||||
@ -64,7 +67,7 @@ async function run(): Promise<void> {
|
||||
}
|
||||
|
||||
// execute the find putting the result of the command in the options foundToolPath
|
||||
await exec.exec(`${vswhereToolExe} ${VSWHERE_EXEC}`, [], options)
|
||||
await exec.exec(`"${vswhereToolExe}" ${VSWHERE_EXEC}`, [], options)
|
||||
|
||||
if (!foundToolPath) {
|
||||
core.setFailed('Unable to find msbuild.')
|
||||
|
Loading…
Reference in New Issue
Block a user