@@ -527,7 +527,7 @@ async function checkAndInstallBinaries(forceInstall?: boolean): Promise<boolean>
527527
528528 const resManager = ResManager . GetInstance ( ) ;
529529
530- const binFolder = resManager . GetBinDir ( ) ;
530+ const binFolder = resManager . getBinDir ( ) ;
531531 const eideCfg = resManager . getAppConfig < any > ( ) ;
532532 const minReqVersion = eideCfg [ 'binary_min_version' ] ;
533533
@@ -854,7 +854,7 @@ function onBinariesInstallDone() {
854854
855855 // get exe file list from folders
856856 for ( const dir of [
857- File . fromArray ( [ resManager . GetBinDir ( ) . path , 'scripts' ] ) ,
857+ File . fromArray ( [ resManager . getBinDir ( ) . path , 'scripts' ] ) ,
858858 File . fromArray ( [ resManager . getLegacyBuilderDir ( ) . path , 'utils' ] )
859859 ] ) {
860860 dir . GetList ( undefined , File . EXCLUDE_ALL_FILTER )
@@ -892,6 +892,9 @@ function cleanLegacyUnifyBuilder() {
892892 }
893893}
894894
895+ async function patchBinaries ( ) {
896+ }
897+
895898//////////////////////////////////////////////////
896899// environment sutup
897900//////////////////////////////////////////////////
@@ -913,7 +916,7 @@ function exportEnvToSysPath(context?: vscode.ExtensionContext) {
913916 File . normalize ( `${ resManager . getBuiltInToolsDir ( ) . path } /utils` ) // builtin util tools
914917 ] ;
915918
916- //
919+ // create ~/.eide/tools dir
917920 const eideToolsFolder = new File ( File . normalize ( `${ platform . userhome ( ) } /.eide/tools` ) ) ;
918921 if ( ! eideToolsFolder . IsDir ( ) ) {
919922 try {
@@ -1220,6 +1223,9 @@ async function InitComponents(context: vscode.ExtensionContext): Promise<boolean
12201223 const done = await checkAndInstallBinaries ( ) ;
12211224 if ( ! done ) { return false ; } /* exit if failed */
12221225
1226+ // binaries patchs
1227+ await patchBinaries ( ) ;
1228+
12231229 // check and install .NET6 runtime
12241230 await checkAndInstallRuntime ( ) ;
12251231
@@ -1257,10 +1263,10 @@ async function InitComponents(context: vscode.ExtensionContext): Promise<boolean
12571263 bar_flash . tooltip = `Upload binary file to device` ;
12581264 }
12591265
1260- // register msys bash profile for windows
1266+ // register bash profile for windows
12611267 if ( os . platform ( ) == 'win32' ) {
1262- context . subscriptions . push ( vscode . window . registerTerminalProfileProvider ( EideTerminalProvider . MSYS_BASH_ID ,
1263- new EideTerminalProvider ( EideTerminalProvider . MSYS_BASH_ID ) ) ) ;
1268+ context . subscriptions . push ( vscode . window . registerTerminalProfileProvider ( EideTerminalProvider . UNIX_BASH_ID ,
1269+ new EideTerminalProvider ( EideTerminalProvider . UNIX_BASH_ID ) ) ) ;
12641270 }
12651271
12661272 context . subscriptions . push (
@@ -1379,7 +1385,7 @@ class EideTaskProvider implements vscode.TaskProvider {
13791385
13801386 if ( platform . osType ( ) == 'win32' ) {
13811387 if ( SettingManager . GetInstance ( ) . isEnableMsys ( ) ) {
1382- bash_executable = ` ${ process . env [ 'EIDE_MSYS' ] } /bash.exe` ;
1388+ bash_executable = ResManager . instance ( ) . getUnixBash ( ) ;
13831389 } else {
13841390 bash_executable = `bash.exe` ;
13851391 }
@@ -1524,7 +1530,7 @@ class EideTerminalLinkProvider implements vscode.TerminalLinkProvider<EideTermin
15241530
15251531class EideTerminalProvider implements vscode . TerminalProfileProvider {
15261532
1527- public static readonly MSYS_BASH_ID = 'eide.msys .bash' ;
1533+ public static readonly UNIX_BASH_ID = 'eide.unix .bash' ;
15281534 public static readonly SYSTEM_SHELL_ID = 'eide.system.shell' ;
15291535
15301536 private type : string ;
@@ -1536,8 +1542,8 @@ class EideTerminalProvider implements vscode.TerminalProfileProvider {
15361542 provideTerminalProfile ( token : vscode . CancellationToken ) : vscode . ProviderResult < vscode . TerminalProfile > {
15371543
15381544 switch ( this . type ) {
1539- case EideTerminalProvider . MSYS_BASH_ID :
1540- return this . provideMsysTerminal ( ) ;
1545+ case EideTerminalProvider . UNIX_BASH_ID :
1546+ return this . provideBashTerminal ( ) ;
15411547 case EideTerminalProvider . SYSTEM_SHELL_ID :
15421548 return this . provideSystemTerminal ( ) ;
15431549 default :
@@ -1602,25 +1608,19 @@ class EideTerminalProvider implements vscode.TerminalProfileProvider {
16021608 } ) ;
16031609 }
16041610
1605- private provideMsysTerminal ( ) : vscode . ProviderResult < vscode . TerminalProfile > {
1611+ private provideBashTerminal ( ) : vscode . ProviderResult < vscode . TerminalProfile > {
16061612
16071613 // welcome msg
16081614 const welcome = [
16091615 `--------------------------------------------` ,
1610- ` \x1b[32;22m welcome to msys bash \x1b[0m` ,
1616+ ` \x1b[32;22m welcome to bash \x1b[0m` ,
16111617 `--------------------------------------------` ,
16121618 ``
16131619 ] ;
16141620
1615- // check bash folder
1616- if ( ! process . env [ 'EIDE_MSYS' ] ||
1617- ! File . IsDir ( process . env [ 'EIDE_MSYS' ] ) ) {
1618- return undefined ;
1619- }
1620-
16211621 return new vscode . TerminalProfile ( {
16221622 name : 'msys bash' ,
1623- shellPath : ` ${ process . env [ 'EIDE_MSYS' ] } /bash.exe` ,
1623+ shellPath : ResManager . instance ( ) . getUnixBash ( ) ,
16241624 cwd : this . cwd ( true ) ,
16251625 env : process . env ,
16261626 strictEnv : true ,
0 commit comments