@@ -13,46 +13,41 @@ public interface IBackend
1313
1414 string FindGitExecutable ( ) ;
1515 string FindVSCode ( ) ;
16+ string FindFleet ( ) ;
1617
1718 void OpenTerminal ( string workdir ) ;
1819 void OpenInFileManager ( string path , bool select ) ;
1920 void OpenBrowser ( string url ) ;
2021 void OpenWithDefaultEditor ( string file ) ;
2122 }
2223
23- public static string GitInstallPath
24- {
25- get ;
26- set ;
27- }
24+ public static string GitInstallPath { get ; set ; }
2825
29- public static string VSCodeExecutableFile
30- {
31- get ;
32- set ;
33- }
26+ public static string VSCodeExecutableFile { get ; set ; }
27+
28+ public static string FleetExecutableFile { get ; set ; }
3429
3530 static OS ( )
3631 {
37- if ( OperatingSystem . IsMacOS ( ) )
32+ if ( OperatingSystem . IsWindows ( ) )
3833 {
39- _backend = new MacOS ( ) ;
40- VSCodeExecutableFile = _backend . FindVSCode ( ) ;
34+ _backend = new Windows ( ) ;
4135 }
42- else if ( OperatingSystem . IsWindows ( ) )
36+ else if ( OperatingSystem . IsMacOS ( ) )
4337 {
44- _backend = new Windows ( ) ;
45- VSCodeExecutableFile = _backend . FindVSCode ( ) ;
38+ _backend = new MacOS ( ) ;
4639 }
4740 else if ( OperatingSystem . IsLinux ( ) )
4841 {
4942 _backend = new Linux ( ) ;
50- VSCodeExecutableFile = _backend . FindVSCode ( ) ;
5143 }
5244 else
5345 {
5446 throw new Exception ( "Platform unsupported!!!" ) ;
5547 }
48+
49+ VSCodeExecutableFile = _backend . FindVSCode ( ) ;
50+ FleetExecutableFile = _backend . FindFleet ( ) ;
5651 }
5752
5853 public static void SetupApp ( AppBuilder builder )
@@ -103,5 +98,22 @@ public static void OpenInVSCode(string repo)
10398 }
10499
105100 private static readonly IBackend _backend = null ;
101+
102+ public static void OpenInFleet ( string repo )
103+ {
104+ if ( string . IsNullOrEmpty ( FleetExecutableFile ) )
105+ {
106+ App . RaiseException ( repo , "Fleet can NOT be found in your system!!!" ) ;
107+ return ;
108+ }
109+
110+ Process . Start ( new ProcessStartInfo ( )
111+ {
112+ WorkingDirectory = repo ,
113+ FileName = FleetExecutableFile ,
114+ Arguments = $ "\" { repo } \" ",
115+ UseShellExecute = false ,
116+ } ) ;
117+ }
106118 }
107119}
0 commit comments