watch method

Future<int> watch()

For CLI Watch and organise image's file according to the setting in the config instance

Implementation

Future<int> watch() async {
  int exitCode = 0;

  run();
  print('Watching...');

  var watcher = DirectoryWatcher(p.absolute(config.assetFolderPath));
  await for (var event in watcher.events) {
    if (event.type == ChangeType.ADD || event.type == ChangeType.MODIFY) {
      var f = File(event.path);
      if (_matchWithFileExtensions(f)) {
        moveFileToItsResolutionFolder(f);
      }
    }
  }

  return exitCode;
}