Skip to content

Commit

Permalink
Show message box when cannot find git binary instead of crash. Add x6…
Browse files Browse the repository at this point in the history
…4 git binary path
  • Loading branch information
zelon committed Jun 8, 2016
1 parent d5811b2 commit 884c9fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion WimyGit/ProgramPathFinder.cs
Expand Up @@ -12,6 +12,7 @@ public static string GetGitBin()
{
string[] git_path_candidates =
{
@"C:\Program Files\Git\bin\git.exe",
@"C:\Program Files (x86)\Git\bin\git.exe",
@"C:\Users\" + Environment.UserName + @"\AppData\Local\Programs\Git\bin\git.exe",
};
Expand All @@ -23,7 +24,7 @@ public static string GetGitBin()
return path;
}
}
throw new Exception("Cannot find git binary");
throw new System.IO.FileNotFoundException("Cannot find git binary");
}

public static string GetGitShell()
Expand Down
12 changes: 10 additions & 2 deletions WimyGit/ViewModel.cs
Expand Up @@ -59,9 +59,17 @@ public void OnChangeDirectory(object parameter)
git_ = new GitWrapper(Directory);

Service.GetInstance().SetRootPath(Directory);
Refresh();

DirectoryUsed(Directory);
try
{
Refresh();
DirectoryUsed(Directory);
}
catch (System.IO.FileNotFoundException ex)
{
Service.GetInstance().ShowMsg(ex.Message);
System.Environment.Exit(1);
}
}

public void Refresh()
Expand Down

0 comments on commit 884c9fd

Please sign in to comment.