diff --git a/CHANGELOG.md b/CHANGELOG.md index c0fe12f..484c930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ This file contains highlights of what changes on each version of the force package. +#### Pub version 0.3.2+1 #### + +- Small improvement in reading out a directory. + #### Pub version 0.3.2 #### - Introducing off(key, datachangelistener) and offAll(key) method, to remove the listeners diff --git a/lib/src/server/file_backend.dart b/lib/src/server/file_backend.dart index a077e89..a32bdaa 100644 --- a/lib/src/server/file_backend.dart +++ b/lib/src/server/file_backend.dart @@ -119,10 +119,10 @@ class FileBackend extends Cargo { dir.list(recursive: true, followLinks: false) .listen((FileSystemEntity entity) { var path = entity.path; - RegExp exp = new RegExp(r"^\\(.+\\)*(.+)\.(.+)$"); - - if (exp.hasMatch(path) && path.indexOf(".json") > 1) { - Match fileName = exp.firstMatch(path); + + if (path.indexOf(".json") > 1) { + var fileName = path.split('\\').last; + fileName = fileName.replaceAll(".json", ''); keys.add(fileName.toString()); } }).onDone(() { diff --git a/pubspec.yaml b/pubspec.yaml index c0596ba..b971f47 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: cargo -version: 0.3.2 +version: 0.3.2+1 author: Joris Hermans description: A key value, storage library for dart homepage: https://github.com/jorishermans/cargo