From daa094006644a70c028ef2d5386e216830484fb0 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sat, 4 Jan 2020 14:44:20 +0100 Subject: [PATCH] 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 #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. --- lib/screens/githostsetup_screens.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/screens/githostsetup_screens.dart b/lib/screens/githostsetup_screens.dart index 5d5a9088..55bc4eab 100644 --- a/lib/screens/githostsetup_screens.dart +++ b/lib/screens/githostsetup_screens.dart @@ -53,7 +53,6 @@ class GitHostSetupScreenState extends State { int _currentPageIndex = 0; Widget _buildPage(BuildContext context, int pos) { - Fimber.d("_buildPage " + pos.toString()); assert(_pageCount >= 1); if (pos == 0) { @@ -279,6 +278,10 @@ class GitHostSetupScreenState extends State { } void _generateSshKey(BuildContext context) { + if (publicKey.isNotEmpty) { + return; + } + var comment = "GitJournal " + Platform.operatingSystem + " " + @@ -287,6 +290,7 @@ class GitHostSetupScreenState extends State { generateSSHKeys(comment: comment).then((String publicKey) { setState(() { this.publicKey = publicKey; + Fimber.d("PublicKey: " + publicKey); _copyKeyToClipboard(context); }); }); @@ -355,6 +359,7 @@ class GitHostSetupScreenState extends State { String repoPath = p.join(basePath, "journal"); String error; try { + Fimber.d("Cloning " + _gitCloneUrl); await GitRepo.clone(repoPath, _gitCloneUrl); } on GitException catch (e) { error = e.cause;