watchChanges function

Future<void> watchChanges()

Watches for changes in the config.yaml and the config.entry_file basedir (where your master strings are).

Implementation

Future<void> watchChanges() async {
  /// listen to changes in trconfig.yaml
  trace(
      '👀 watch mode enabled for:\n - 📁 ${config.inputYamlDir}: and\n - 🗒 $configPath:');
  print('Press ${yellow('q')} then ${yellow('Enter')} to exit the program');
  _listenConfigChanges();
  _listenMasterStringsFilesChanges();
  await stdin.firstWhere((e) {
    var str = utf8.decode(e);

    /// press q to quit.
    if (str.trim() == 'q') {
      return true;
    }
    return false;
  });
}