mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-02 04:47:01 +08:00
Make sure local git repo always exists
There are some cases when upgrading from a really old version that the journal_local no longer exists.
This commit is contained in:
16
lib/app.dart
16
lib/app.dart
@ -71,7 +71,21 @@ class JournalApp extends StatefulWidget {
|
|||||||
Log.i("New Documents Directory Path ${dir.path}");
|
Log.i("New Documents Directory Path ${dir.path}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appState.localGitRepoConfigured == false) {
|
// Handle migrations - Remove this code in 2021
|
||||||
|
var localConfigured = appState.localGitRepoConfigured;
|
||||||
|
if (localConfigured && appState.remoteGitRepoConfigured == false) {
|
||||||
|
appState.localGitRepoFolderName = "journal_local";
|
||||||
|
var repoPath = p.join(
|
||||||
|
appState.gitBaseDirectory,
|
||||||
|
appState.localGitRepoFolderName,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!Directory(repoPath).existsSync()) {
|
||||||
|
localConfigured = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (localConfigured == false) {
|
||||||
// FIXME: What about exceptions!
|
// FIXME: What about exceptions!
|
||||||
appState.localGitRepoFolderName = "journal_local";
|
appState.localGitRepoFolderName = "journal_local";
|
||||||
var repoPath = p.join(
|
var repoPath = p.join(
|
||||||
|
Reference in New Issue
Block a user