loadDpkYamlRaw function

dynamic loadDpkYamlRaw(
  1. Directory directory
)

Loads a dpk.yaml file from the given directory and returns it as a raw YAML object. Returns null if the file doesn't exist. The return type is dynamic because loadYaml returns YamlMap, which implements Map.

Implementation

dynamic loadDpkYamlRaw(Directory directory) {
  final configFile = File(join(directory.path, kConfigFileName));

  if (!configFile.existsSync()) {
    return null;
  }

  return loadYaml(configFile.readAsStringSync());
}