getOptionMorphemeYaml method

String getOptionMorphemeYaml()

Gets the custom path to morpheme.yaml.

Returns the custom path to the morpheme.yaml configuration file. If not specified, looks for a default path in pubspec.yaml or falls back to morpheme.yaml in the current directory.

Example:

final morphemeYamlPath = argResults.getOptionMorphemeYaml();

Implementation

String getOptionMorphemeYaml() {
  final path = join(current, 'pubspec.yaml');
  if (exists(path)) {
    final pathMorphemeCli = YamlHelper.loadFileYaml(path)['morpheme_cli'];
    if (pathMorphemeCli != null) {
      return pathMorphemeCli;
    }
  }
  return this?['morpheme-yaml'] ?? join(current, 'morpheme.yaml');
}