AFCodeBuffer.fromPath constructor

AFCodeBuffer.fromPath(
  1. List<String> projectPath
)

Returns a code buffer containing the contents of the file

projectPath is relative to the project root.

Implementation

factory AFCodeBuffer.fromPath(List<String> projectPath) {
  if(!AFProjectPaths.projectFileExists(projectPath)) {
     throw AFCommandError(error: "Expected to find file at $projectPath but did not.", usage: "");
  }

  final fullPath = AFProjectPaths.fullPathFor(projectPath);
  return AFCodeBuffer.fromFullPath(projectPath, fullPath);
}