1- import  *  as  vscode  from  'vscode' ; 
21import  { IgnoreCommandConfig }  from  '../types/commands' ; 
32import  { CliCommands ,  CommandParameters ,  getScanTypeCliValue }  from  './constants' ; 
43import  { IConfig ,  RunCliResult ,  UserAgent }  from  './types' ; 
54import  { getRunnableCliCommand }  from  './runner' ; 
6- import  { experimentalScaSyncFlowProperty ,  extensionId }  from  '../utils/texts' ; 
75
8- export   const  generateUserAgentCommandParam  =  ( config : IConfig )  =>  { 
6+ const  generateUserAgentCommandParam  =  ( config : IConfig )  =>  { 
97  const  userAgent : UserAgent  =  { 
108    app_name : config . agentName , 
119    app_version : config . agentVersion , 
@@ -19,33 +17,22 @@ export const generateUserAgentCommandParam = (config: IConfig) => {
1917} ; 
2018
2119export  const  cliWrapper  =  { 
22-   getRunnableGetVersionLegacyCommand : ( params : { 
23-     config : IConfig ; 
24-     workspaceFolderPath : string ; 
25-   } ) : RunCliResult  =>  { 
26-     // support for legacy versions of the CLI (< 1.0.0) 
27-     const  { config,  workspaceFolderPath}  =  params ; 
28-     const  { cliPath,  cliEnv}  =  config ; 
29- 
30-     return  getRunnableCliCommand ( { 
31-       cliPath, 
32-       workspaceFolderPath, 
33-       commandParams : [ CommandParameters . Version ] , 
34-       cliEnv, 
35-       printToOutput : true , 
36-     } ) ; 
37-   } , 
3820  getRunnableGetVersionCommand : ( params : { 
3921    config : IConfig ; 
4022    workspaceFolderPath ?: string ; 
4123  } ) : RunCliResult  =>  { 
4224    const  { config,  workspaceFolderPath}  =  params ; 
4325    const  { cliPath,  cliEnv}  =  config ; 
4426
27+     const  commandParams : string [ ]  =  [ ] ; 
28+     commandParams . push ( generateUserAgentCommandParam ( config ) ) ; 
29+     commandParams . push ( CommandParameters . OutputFormatJson ) ; 
30+     commandParams . push ( CliCommands . Version ) ; 
31+ 
4532    return  getRunnableCliCommand ( { 
4633      cliPath, 
4734      workspaceFolderPath, 
48-       commandParams :  [ CliCommands . Version ] , 
35+       commandParams, 
4936      cliEnv, 
5037      printToOutput : true , 
5138    } ) ; 
@@ -96,9 +83,7 @@ export const cliWrapper = {
9683    commandParams . push ( CommandParameters . scanType ) ; 
9784    commandParams . push ( CommandParameters . SCAScanType ) ; 
9885
99-     const  experimentalScaSyncFlowPropertyEnabled  = 
100-         vscode . workspace . getConfiguration ( extensionId ) . get ( experimentalScaSyncFlowProperty ) ; 
101-     if  ( experimentalScaSyncFlowPropertyEnabled )  { 
86+     if  ( config . experimentalScaSyncFlow )  { 
10287      // TODO(MarshalX): remove experimental setting if stable 
10388      commandParams . push ( CommandParameters . Sync ) ; 
10489      commandParams . push ( CommandParameters . NoRestore ) ; 
@@ -145,40 +130,6 @@ export const cliWrapper = {
145130
146131    return  getRunnableCliCommand ( { cliPath,  cliEnv,  commandParams} ) ; 
147132  } , 
148-   getRunnablePipInstallCommand : ( params : { 
149-     config : IConfig ; 
150-     workspaceFolderPath ?: string ; 
151-   } ) : RunCliResult  =>  { 
152-     const  commandParams : string [ ]  =  [ ] ; 
153-     const  { config,  workspaceFolderPath}  =  params ; 
154-     const  { cliEnv}  =  config ; 
155-     commandParams . push ( 'install' ) ; 
156-     commandParams . push ( '--upgrade' ) ; 
157-     commandParams . push ( 'cycode' ) ; 
158- 
159-     return  getRunnableCliCommand ( { 
160-       cliPath : 'pip' , 
161-       workspaceFolderPath, 
162-       commandParams, 
163-       cliEnv, 
164-       printToOutput : true , 
165-     } ) ; 
166-   } , 
167-   getRunnablePipUninstallCommand : ( params : { 
168-     config : IConfig ; 
169-     workspaceFolderPath ?: string ; 
170-   } ) : RunCliResult  =>  { 
171-     const  { config,  workspaceFolderPath}  =  params ; 
172-     const  { cliEnv}  =  config ; 
173- 
174-     return  getRunnableCliCommand ( { 
175-       cliPath : 'pip3' , 
176-       workspaceFolderPath, 
177-       commandParams : [ 'uninstall' ,  '-y' ,  'cycode' ] , 
178-       cliEnv, 
179-       printToOutput : true , 
180-     } ) ; 
181-   } , 
182133  getRunnableIgnoreCommand : ( params : { 
183134    config : IConfig ; 
184135    workspaceFolderPath ?: string ; 
0 commit comments