Skip to content

Commit

Permalink
Fix a bug with rinf message on empty folders
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Jan 13, 2024
1 parent ad2f199 commit 7eb53e4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flutter_ffi_plugin/bin/rinf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ Future<void> _generateMessageCode({bool silent = false}) async {
final subPath = entry.key;
final resourceNames = entry.value;
await Directory('$rustOutputPath$subPath').create(recursive: true);
if (resourceNames.length == 0) {
continue;
}
final protoPaths = <String>[];
for (final key in resourcesInFolders.keys) {
protoPaths.add('--proto_path=$protoPath$key');
Expand Down Expand Up @@ -536,6 +539,9 @@ Future<void> _generateMessageCode({bool silent = false}) async {
final subPath = entry.key;
final resourceNames = entry.value;
await Directory('$dartOutputPath$subPath').create(recursive: true);
if (resourceNames.length == 0) {
continue;
}
final protoPaths = <String>[];
for (final key in resourcesInFolders.keys) {
protoPaths.add('--proto_path=$protoPath$key');
Expand Down Expand Up @@ -633,7 +639,5 @@ Future<void> _collectProtoFiles(
}
}
final folderPath = directory.path.replaceFirst(rootDirectory.path, '');
if (resources.length > 0) {
resourcesInFolders[folderPath] = resources;
}
resourcesInFolders[folderPath] = resources;
}

0 comments on commit 7eb53e4

Please sign in to comment.