mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +08:00
ios: Fix setSshKeys
Forgot to write the private key to disk
This commit is contained in:
@ -45,6 +45,9 @@ static FlutterMethodChannel* gitChannel = 0;
|
||||
NSArray *sshPublicComponents = [NSArray arrayWithObjects:filesDir, @"ssh", @"id_rsa.pub", nil];
|
||||
NSString *sshPublicKeyString = [NSString pathWithComponents:sshPublicComponents];
|
||||
|
||||
NSArray *sshPrivateComponents = [NSArray arrayWithObjects:filesDir, @"ssh", @"id_rsa", nil];
|
||||
NSString *sshPrivateKeyString = [NSString pathWithComponents:sshPrivateComponents];
|
||||
|
||||
if ([@"getBaseDirectory" isEqualToString:method]) {
|
||||
result(filesDir);
|
||||
}
|
||||
@ -247,6 +250,14 @@ static FlutterMethodChannel* gitChannel = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
[privateKey writeToFile:sshPrivateKeyString atomically:YES encoding:NSUTF8StringEncoding error:&error];
|
||||
|
||||
if (error != nil) {
|
||||
result([FlutterError errorWithCode:@"FAILED"
|
||||
message:[error localizedDescription] details:nil]);
|
||||
return;
|
||||
}
|
||||
|
||||
result(@YES);
|
||||
}
|
||||
else if ([@"dumpAppLogs" isEqualToString:method]) {
|
||||
|
Reference in New Issue
Block a user