Skip to content

Commit

Permalink
Export setupMSVCDevCmd to allow library usage (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Sep 16, 2021
1 parent 74a501b commit f456b80
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit f456b80

Please sign in to comment.