@@ -36,6 +36,7 @@ import {
3636 InterpreterUri ,
3737 IProductPathService ,
3838 IProductService ,
39+ ModuleInstallFlags ,
3940} from './types' ;
4041
4142export { Product } from '../types' ;
@@ -72,7 +73,7 @@ abstract class BaseInstaller {
7273 product : Product ,
7374 resource ?: InterpreterUri ,
7475 cancel ?: CancellationToken ,
75- isUpgrade ?: boolean ,
76+ flags ?: ModuleInstallFlags ,
7677 ) : Promise < InstallerResponse > {
7778 // If this method gets called twice, while previous promise has not been resolved, then return that same promise.
7879 // E.g. previous promise is not resolved as a message has been displayed to the user, so no point displaying
@@ -83,7 +84,7 @@ abstract class BaseInstaller {
8384 if ( BaseInstaller . PromptPromises . has ( key ) ) {
8485 return BaseInstaller . PromptPromises . get ( key ) ! ;
8586 }
86- const promise = this . promptToInstallImplementation ( product , resource , cancel , isUpgrade ) ;
87+ const promise = this . promptToInstallImplementation ( product , resource , cancel , flags ) ;
8788 BaseInstaller . PromptPromises . set ( key , promise ) ;
8889 promise . then ( ( ) => BaseInstaller . PromptPromises . delete ( key ) ) . ignoreErrors ( ) ;
8990 promise . catch ( ( ) => BaseInstaller . PromptPromises . delete ( key ) ) . ignoreErrors ( ) ;
@@ -95,7 +96,7 @@ abstract class BaseInstaller {
9596 product : Product ,
9697 resource ?: InterpreterUri ,
9798 cancel ?: CancellationToken ,
98- isUpgrade ?: boolean ,
99+ flags ?: ModuleInstallFlags ,
99100 ) : Promise < InstallerResponse > {
100101 if ( product === Product . unittest ) {
101102 return InstallerResponse . Installed ;
@@ -112,7 +113,7 @@ abstract class BaseInstaller {
112113 }
113114
114115 await installer
115- . installModule ( product , resource , cancel , isUpgrade )
116+ . installModule ( product , resource , cancel , flags )
116117 . catch ( ( ex ) => traceError ( `Error in installing the product '${ ProductNames . get ( product ) } ', ${ ex } ` ) ) ;
117118
118119 return this . isInstalled ( product , resource ) . then ( ( isInstalled ) => {
@@ -207,7 +208,7 @@ abstract class BaseInstaller {
207208 product : Product ,
208209 resource ?: InterpreterUri ,
209210 cancel ?: CancellationToken ,
210- isUpgrade ?: boolean ,
211+ flags ?: ModuleInstallFlags ,
211212 ) : Promise < InstallerResponse > ;
212213
213214 protected getExecutableNameFromSettings ( product : Product , resource ?: Uri ) : string {
@@ -349,7 +350,7 @@ class DataScienceInstaller extends BaseInstaller {
349350 product : Product ,
350351 interpreterUri ?: InterpreterUri ,
351352 cancel ?: CancellationToken ,
352- isUpgrade ?: boolean ,
353+ flags ?: ModuleInstallFlags ,
353354 ) : Promise < InstallerResponse > {
354355 // Precondition
355356 if ( isResource ( interpreterUri ) ) {
@@ -390,7 +391,7 @@ class DataScienceInstaller extends BaseInstaller {
390391 }
391392
392393 await installerModule
393- . installModule ( product , interpreter , cancel , isUpgrade )
394+ . installModule ( product , interpreter , cancel , flags )
394395 . catch ( ( ex ) => traceError ( `Error in installing the module '${ moduleName } ', ${ ex } ` ) ) ;
395396
396397 return this . isInstalled ( product , interpreter ) . then ( ( isInstalled ) => {
@@ -447,15 +448,15 @@ export class ProductInstaller implements IInstaller {
447448 product : Product ,
448449 resource ?: InterpreterUri ,
449450 cancel ?: CancellationToken ,
450- isUpgrade ?: boolean ,
451+ flags ?: ModuleInstallFlags ,
451452 ) : Promise < InstallerResponse > {
452453 const currentInterpreter = isResource ( resource )
453454 ? await this . interpreterService . getActiveInterpreter ( resource )
454455 : resource ;
455456 if ( ! currentInterpreter ) {
456457 return InstallerResponse . Ignore ;
457458 }
458- return this . createInstaller ( product ) . promptToInstall ( product , resource , cancel , isUpgrade ) ;
459+ return this . createInstaller ( product ) . promptToInstall ( product , resource , cancel , flags ) ;
459460 }
460461
461462 public async isProductVersionCompatible (
@@ -470,9 +471,9 @@ export class ProductInstaller implements IInstaller {
470471 product : Product ,
471472 resource ?: InterpreterUri ,
472473 cancel ?: CancellationToken ,
473- isUpgrade ?: boolean ,
474+ flags ?: ModuleInstallFlags ,
474475 ) : Promise < InstallerResponse > {
475- return this . createInstaller ( product ) . install ( product , resource , cancel , isUpgrade ) ;
476+ return this . createInstaller ( product ) . install ( product , resource , cancel , flags ) ;
476477 }
477478
478479 public async isInstalled ( product : Product , resource ?: InterpreterUri ) : Promise < boolean > {
0 commit comments