Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Ensure consistent return type from setEnvironment #183

Merged
merged 1 commit into from
Apr 22, 2019
Merged

Ensure consistent return type from setEnvironment #183

merged 1 commit into from
Apr 22, 2019

Conversation

dr3x
Copy link
Contributor

@dr3x dr3x commented Apr 19, 2019

In setEnvironment(), a different type is returned if you are skipping configuration instead of invoking the executeChildProcess. When the caller attempts to chain off the result you get the following type error:

TypeError: Cannot read property 'then' of undefined

This is the caller code snippet invoking setEnvironment:

setEnvironment(variables).then(() => process.exit(0)).catch(() =>process.exit(1));`

TypeError: Cannot read property 'then' of undefined
at install_1.install (C:\Users\Dave\AppData\Roaming\npm\node_modules\windows-build-tools\dist\start.js:19:17)

Should fix #175 win10 ver17763.316 Could not install Visual Studio Build Tools.

@@ -45,7 +45,8 @@ export function setEnvironment(env: InstallationDetails) {
log(chalk.bold.green(`Now configuring the Visual Studio Build Tools..`));
} else {
log(chalk.bold.green(`Skipping configuration: No configuration for Python or Visual Studio Build Tools required.`));
return;
return(new Promise((resolve, reject) => resolve()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobq
Copy link
Collaborator

jacobq commented Apr 19, 2019

Aha! I didn't notice that sneaky extra return.

@felixrieseberg
Copy link
Owner

This looks solid to me, thank you!

@felixrieseberg felixrieseberg merged commit 8ce7ebd into felixrieseberg:master Apr 22, 2019
@dr3x dr3x deleted the pullrequests branch May 23, 2019 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win10 ver17763.316 Could not install Visual Studio Build Tools.
3 participants