File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 66import * as fse from 'fs-extra' ;
77import { ProjectRuntime } from '../constants' ;
88import { ext } from '../extensionVariables' ;
9+ import { localize } from '../localize' ;
910import { dotnetUtils } from '../utils/dotnetUtils' ;
1011import { downloadFile } from '../utils/fs' ;
1112import { cliFeedJsonResponse } from '../utils/getCliFeedJson' ;
@@ -80,7 +81,7 @@ export function getDotnetVerifiedTemplateIds(runtime: string): string[] {
8081 case ProjectRuntime . beta :
8182 return `${ id } .2.x` ;
8283 default :
83- throw new RangeError ( ) ;
84+ throw new RangeError ( localize ( 'invalidRuntime' , 'Invalid runtime "{0}".' , runtime ) ) ;
8485 }
8586 } ) ;
8687}
Original file line number Diff line number Diff line change @@ -68,22 +68,22 @@ export class FunctionAppProvider implements IChildProvider {
6868
6969async function getDefaultRuntime ( actionContext : IActionContext ) : Promise < ProjectRuntime > {
7070 // Try to get VS Code setting for runtime (aka if they have a project open)
71- let runtime : ProjectRuntime | undefined = getFuncExtensionSetting ( projectRuntimeSetting ) ;
71+ let runtime : string | undefined = getFuncExtensionSetting ( projectRuntimeSetting ) ;
7272 actionContext . properties . runtimeSource = 'VSCodeSetting' ;
7373
74- if ( runtime === undefined ) {
74+ if ( ! runtime ) {
7575 // Try to get the runtime that matches their local func cli version
7676 runtime = await tryGetLocalRuntimeVersion ( ) ;
7777 actionContext . properties . runtimeSource = 'LocalFuncCli' ;
7878 }
7979
80- if ( runtime === undefined ) {
80+ if ( ! runtime ) {
8181 // Default to v1 if all else fails
8282 runtime = ProjectRuntime . one ;
8383 actionContext . properties . runtimeSource = 'Backup' ;
8484 }
8585
8686 actionContext . properties . projectRuntime = runtime ;
8787
88- return runtime ;
88+ return < ProjectRuntime > runtime ;
8989}
Original file line number Diff line number Diff line change 77import request = require( 'request-promise' ) ;
88import { callWithTelemetryAndErrorHandling , IActionContext } from 'vscode-azureextensionui' ;
99import { ProjectRuntime } from '../constants' ;
10+ import { localize } from '../localize' ;
1011
1112const funcCliFeedUrl : string = 'https://aka.ms/V00v5v' ;
1213const v1DefaultNodeVersion : string = '6.5.0' ;
@@ -51,7 +52,7 @@ export function getFeedRuntime(runtime: ProjectRuntime): string {
5152 case ProjectRuntime . one :
5253 return 'v1' ;
5354 default :
54- throw new RangeError ( ) ;
55+ throw new RangeError ( localize ( 'invalidRuntime' , 'Invalid runtime "{0}".' , runtime ) ) ;
5556 }
5657}
5758
You can’t perform that action at this time.
0 commit comments