Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap emulator Node runtime discovery to favor local cache #2740

Merged
merged 12 commits into from
Oct 28, 2020
Prev Previous commit
Next Next commit
Patch emulator node runtime discovery to favor local cache
  • Loading branch information
abeisgoat committed Oct 23, 2020
commit 7f7f8c24867745e25b48065cf4c47c42bab40911
16 changes: 8 additions & 8 deletions src/emulator/functionsEmulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,24 +707,24 @@ export class FunctionsEmulator implements EmulatorInstance {
// Will happen if we haven't asked about local version yet
}

// If the requested version is the same as the host, let's use that
if (requestedMajorVersion === hostMajorVersion) {
// If the requested version is already locally available, let's use that
if (requestedMajorVersion === localMajorVersion) {
this.logger.logLabeled(
"SUCCESS",
"functions",
`Using node@${requestedMajorVersion} from host.`
`Using node@${requestedMajorVersion} from local cache.`
);
return process.execPath;
return localNodePath;
}

// If the requested version is already locally available, let's use that
if (localMajorVersion === requestedMajorVersion) {
// If the requested version is the same as the host, let's use that
if (requestedMajorVersion === hostMajorVersion) {
this.logger.logLabeled(
"SUCCESS",
"functions",
`Using node@${requestedMajorVersion} from local cache.`
`Using node@${requestedMajorVersion} from host.`
);
return localNodePath;
return process.execPath;
}

// Otherwise we'll begin the conversational flow to install the correct version locally
Expand Down