diff --git a/lib/setup/screens.dart b/lib/setup/screens.dart index 529994e5..f5c85b0e 100644 --- a/lib/setup/screens.dart +++ b/lib/setup/screens.dart @@ -496,9 +496,13 @@ class GitHostSetupScreenState extends State { // Add a GitIgnore file. This way we always at least have one commit // It makes doing a git pull and push easier // - var gitIgnorePath = p.join(repoPath, ".gitignore"); - var ignoreFile = File(gitIgnorePath); - if (!ignoreFile.existsSync()) { + var anyFileInRepo = Directory(repoPath).list().firstWhere( + (fs) => fs.statSync().type == FileSystemEntityType.file, + orElse: () => null, + ); + if (anyFileInRepo == null) { + Log.i("Adding .ignore file"); + var ignoreFile = File(p.join(repoPath, ".gitignore")); ignoreFile.createSync(); var repo = GitRepo(