Skip to content

Commit daa0940

Browse files
committed
Remote Setup: Only generate the key if not already generated
This way one can go back and change the clone url if one wants to and the ssh key would not have changed. There is an additional SSH Key changing button if one needs to regenerate it for some reason. This should fix GitJournal#47. Well, it's not the best solution, but it is a workaround. For the Clone Url you must enter SSH-KEY-ID@clone-url-provided-by-aws. In order to get the SSH KEY ID you must upload the public key provdied to your AWS Credentials.
1 parent c21287e commit daa0940

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/screens/githostsetup_screens.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
5353
int _currentPageIndex = 0;
5454

5555
Widget _buildPage(BuildContext context, int pos) {
56-
Fimber.d("_buildPage " + pos.toString());
5756
assert(_pageCount >= 1);
5857

5958
if (pos == 0) {
@@ -279,6 +278,10 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
279278
}
280279

281280
void _generateSshKey(BuildContext context) {
281+
if (publicKey.isNotEmpty) {
282+
return;
283+
}
284+
282285
var comment = "GitJournal " +
283286
Platform.operatingSystem +
284287
" " +
@@ -287,6 +290,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
287290
generateSSHKeys(comment: comment).then((String publicKey) {
288291
setState(() {
289292
this.publicKey = publicKey;
293+
Fimber.d("PublicKey: " + publicKey);
290294
_copyKeyToClipboard(context);
291295
});
292296
});
@@ -355,6 +359,7 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
355359
String repoPath = p.join(basePath, "journal");
356360
String error;
357361
try {
362+
Fimber.d("Cloning " + _gitCloneUrl);
358363
await GitRepo.clone(repoPath, _gitCloneUrl);
359364
} on GitException catch (e) {
360365
error = e.cause;

0 commit comments

Comments
 (0)