File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed
Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ namespace PassWinmenuTests.Configuration
77 public class RuntimeConfigurationTests
88 {
99 [ Fact ]
10- public void Parse_NoArgs_ConfigFileLocationIsNull ( )
10+ public void Parse_NoArgs_SetsDefaultLocation ( )
1111 {
1212 var config = RuntimeConfiguration . Parse ( new [ ] { "app.exe" } ) ;
1313
14- config . ConfigFileLocation . ShouldBeNull ( ) ;
14+ config . ConfigFileLocation . ShouldEndWith ( "pass-winmenu.yaml" ) ;
1515 }
1616
1717 [ Fact ]
Original file line number Diff line number Diff line change 1+ using System ;
12using System . IO ;
2- using System . Reflection ;
33
44#nullable enable
55namespace PassWinmenu . Configuration
@@ -14,8 +14,8 @@ private RuntimeConfiguration()
1414
1515 internal static RuntimeConfiguration Parse ( string [ ] args )
1616 {
17- var executableDirectory = Path . GetDirectoryName ( Assembly . GetEntryAssembly ( ) ! . Location ) ;
18- var defaultConfigPath = Path . Combine ( executableDirectory ! , "pass-winmenu.yaml" ) ;
17+ var executableDirectory = AppDomain . CurrentDomain . BaseDirectory ;
18+ var defaultConfigPath = Path . Combine ( executableDirectory , "pass-winmenu.yaml" ) ;
1919
2020 var configuration = new RuntimeConfiguration
2121 {
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ private void LoadConfigFile(RuntimeConfiguration runtimeConfig)
250250 "Would you like to open it now?" , "New configuration file created" , MessageBoxButton . YesNo ) ;
251251 if ( open == MessageBoxResult . Yes )
252252 {
253- Process . Start ( runtimeConfig . ConfigFileLocation ) ;
253+ Process . Start ( "explorer" , runtimeConfig . ConfigFileLocation ) ;
254254 }
255255
256256 App . Exit ( ) ;
@@ -262,7 +262,7 @@ private void LoadConfigFile(RuntimeConfiguration runtimeConfig)
262262 "Would you like to open both files now?" , "Configuration file out of date" , MessageBoxButton . YesNo ) ;
263263 if ( openBoth == MessageBoxResult . Yes )
264264 {
265- Process . Start ( runtimeConfig . ConfigFileLocation ) ;
265+ Process . Start ( "explorer" , runtimeConfig . ConfigFileLocation ) ;
266266 Process . Start ( backedUpFile ) ;
267267 }
268268 App . Exit ( ) ;
Original file line number Diff line number Diff line change @@ -45,7 +45,12 @@ public GpgHomeDirectory GetHomeDir()
4545 /// </summary>
4646 private string GetDefaultHomeDir ( )
4747 {
48- var psi = new ProcessStartInfo ( installation . GpgConfExecutable . FullName , "--list-dirs" ) ;
48+ var psi = new ProcessStartInfo ( installation . GpgConfExecutable . FullName , "--list-dirs" )
49+ {
50+ RedirectStandardOutput = true ,
51+ UseShellExecute = false ,
52+ } ;
53+
4954 var gpgConf = processes . Start ( psi ) ;
5055
5156 var lines = gpgConf . StandardOutput . ReadAllLines ( ) ;
You can’t perform that action at this time.
0 commit comments