From 66cdda213a2e5263dd41a0edc11b086ff3095ddb Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Wed, 6 Feb 2019 15:34:57 +0100 Subject: [PATCH] Fix gitClone from github The test still fails, but via the app cloning seems to work. Progress!! --- android/app/build.gradle | 1 + lib/screens/githostsetup_screens.dart | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index ad05b6e5..0edeeb94 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -74,6 +74,7 @@ dependencies { { exclude group: 'org.apache.httpcomponents', module: 'httpclient' } + implementation 'com.jcraft:jsch:0.1.54' // For reading a file to string implementation 'commons-io:commons-io:2.5' diff --git a/lib/screens/githostsetup_screens.dart b/lib/screens/githostsetup_screens.dart index d8f3592e..986f5e21 100644 --- a/lib/screens/githostsetup_screens.dart +++ b/lib/screens/githostsetup_screens.dart @@ -395,7 +395,13 @@ class GitHostSetupScreenState extends State { // Just in case it was half cloned because of an error await _removeExistingClone(basePath); - String error = await gitClone(_gitCloneUrl, "journal"); + String error; + try { + await gitClone(_gitCloneUrl, "journal"); + } catch (e) { + error = e.message; + } + if (error != null && error.isNotEmpty) { setState(() { getAnalytics().logEvent(