Add StringCollection to make it easier to work with strings

This commit is contained in:
Kim Biesbjerg
2016-12-09 05:18:04 +01:00
parent befd841457
commit 73801a9cc5
17 changed files with 204 additions and 111 deletions

View File

@@ -34,10 +34,10 @@ var destination = path.join(options.output, filename);
try {
var extractor = new Extractor(serializer);
var messages = extractor.extract(options.dir);
if (messages.length > 0) {
var collection = extractor.process(options.dir);
if (collection.count() > 0) {
extractor.save(destination);
cli.ok(`Extracted ${messages.length} strings: '${destination}'`);
cli.ok(`Extracted ${collection.count()} strings: '${destination}'`);
} else {
cli.info(`Found no extractable strings in the supplied directory path: '${options.dir}'`);
}