controller: still try to guess the key name if the user changes the email address in config.xml
This commit is contained in:
parent
e367614390
commit
3fc192484a
|
@ -750,12 +750,23 @@ namespace SparkleShare {
|
||||||
{
|
{
|
||||||
string keys_path = Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath);
|
string keys_path = Path.GetDirectoryName (SparkleConfig.DefaultConfig.FullPath);
|
||||||
string key_file_name = "sparkleshare." + UserEmail + ".key";
|
string key_file_name = "sparkleshare." + UserEmail + ".key";
|
||||||
|
string key_file_path = Path.Combine (keys_path, key_file_name);
|
||||||
|
|
||||||
|
if (!File.Exists (key_file_path)) {
|
||||||
|
foreach (string file_name in Directory.GetFiles (keys_path)) {
|
||||||
|
if (file_name.StartsWith ("sparkleshare") &&
|
||||||
|
file_name.EndsWith (".key")) {
|
||||||
|
|
||||||
|
key_file_path = Path.Combine (keys_path, file_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Process process = new Process ();
|
Process process = new Process ();
|
||||||
process.StartInfo.RedirectStandardOutput = true;
|
process.StartInfo.RedirectStandardOutput = true;
|
||||||
process.StartInfo.UseShellExecute = false;
|
process.StartInfo.UseShellExecute = false;
|
||||||
process.StartInfo.FileName = "ssh-add";
|
process.StartInfo.FileName = "ssh-add";
|
||||||
process.StartInfo.Arguments = "\"" + Path.Combine (keys_path, key_file_name) + "\"";
|
process.StartInfo.Arguments = "\"" + key_file_path + "\"";
|
||||||
|
|
||||||
process.Start ();
|
process.Start ();
|
||||||
process.WaitForExit ();
|
process.WaitForExit ();
|
||||||
|
|
Loading…
Reference in a new issue