diff --git a/index.js b/index.js index f4fbd73..f8025ae 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,8 @@ function filterPathValue(path) { return paths.filter(unique).join(';') } -function main() { +/** See https://github.com/ilammy/msvc-dev-cmd#inputs */ +function setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre) { if (process.platform != 'win32') { core.info('This is not a Windows virtual environment, bye!') return @@ -79,12 +80,6 @@ function main() { // Add standard location of "vswhere" to PATH, in case it's not there. process.env.PATH += path.delimiter + VSWHERE_PATH - var arch = core.getInput('arch') - const sdk = core.getInput('sdk') - const toolset = core.getInput('toolset') - const uwp = core.getInput('uwp') - const spectre = core.getInput('spectre') - // There are all sorts of way the architectures are called. In addition to // values supported by Microsoft Visual C++, recognize some common aliases. let arch_aliases = { @@ -177,6 +172,17 @@ function main() { core.info(`Configured Developer Command Prompt`) } +exports.setupMSVCDevCmd = setupMSVCDevCmd + +function main() { + var arch = core.getInput('arch') + const sdk = core.getInput('sdk') + const toolset = core.getInput('toolset') + const uwp = core.getInput('uwp') + const spectre = core.getInput('spectre') + + setupMSVCDevCmd(arch, sdk, toolset, uwp, spectre) +} try { main()