diff --git a/lib/spider.dart b/lib/spider.dart index a849fed..bc3c11a 100644 --- a/lib/spider.dart +++ b/lib/spider.dart @@ -71,7 +71,7 @@ class Spider { if (group.path.isEmpty) { exit_with('Exmpty paths are not allowed'); } - if (File(group.path).existsSync()) { + if (!FileSystemEntity.isDirectorySync(group.path)) { exit_with('Path ${group.path} is not a directory'); } if (!Directory(group.path).existsSync()) { diff --git a/lib/src/dart_class_generator.dart b/lib/src/dart_class_generator.dart index c067674..60496ef 100644 --- a/lib/src/dart_class_generator.dart +++ b/lib/src/dart_class_generator.dart @@ -103,6 +103,7 @@ ${properties_strings.join('\n')} /// 2. should be from one of the allowed types if specified any bool _isValidFile(dynamic file) { return FileSystemEntity.isFileSync(file.path) && + path.extension(file.path).isNotEmpty && (group.types.isEmpty || group.types.contains(path.extension(file.path))); }