ReleasePacker.fromFile constructor

ReleasePacker.fromFile(
  1. File file, {
  2. Map<String, String>? properties,
  3. Directory? rootDirectory,
  4. bool allowPropertiesFromEnv = false,
})

Implementation

factory ReleasePacker.fromFile(
  File file, {
  Map<String, String>? properties,
  Directory? rootDirectory,
  bool allowPropertiesFromEnv = false,
}) {
  var json = _readFile(file, expected: true);
  if (json == null) {
    throw StateError("Can't read JSON from file: $file");
  }
  return ReleasePacker.fromJson(json,
      properties: properties,
      rootDirectory: rootDirectory ?? file.parent,
      allowPropertiesFromEnv: allowPropertiesFromEnv);
}