mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +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];
|
NSArray *sshPublicComponents = [NSArray arrayWithObjects:filesDir, @"ssh", @"id_rsa.pub", nil];
|
||||||
NSString *sshPublicKeyString = [NSString pathWithComponents:sshPublicComponents];
|
NSString *sshPublicKeyString = [NSString pathWithComponents:sshPublicComponents];
|
||||||
|
|
||||||
|
NSArray *sshPrivateComponents = [NSArray arrayWithObjects:filesDir, @"ssh", @"id_rsa", nil];
|
||||||
|
NSString *sshPrivateKeyString = [NSString pathWithComponents:sshPrivateComponents];
|
||||||
|
|
||||||
if ([@"getBaseDirectory" isEqualToString:method]) {
|
if ([@"getBaseDirectory" isEqualToString:method]) {
|
||||||
result(filesDir);
|
result(filesDir);
|
||||||
}
|
}
|
||||||
@ -247,6 +250,14 @@ static FlutterMethodChannel* gitChannel = 0;
|
|||||||
return;
|
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);
|
result(@YES);
|
||||||
}
|
}
|
||||||
else if ([@"dumpAppLogs" isEqualToString:method]) {
|
else if ([@"dumpAppLogs" isEqualToString:method]) {
|
||||||
|
Reference in New Issue
Block a user