Export setupMSVCDevCmd to allow library usage (#47)

This commit is contained in:
Amin Yahyaabadi
2021-09-15 19:11:51 -05:00
committed by GitHub
parent 74a501b087
commit f456b805b3
+13 -7
View File
@@ -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()