add method

Future<CachedBrick> add(
  1. Brick brick
)

Caches brick if necessary and updates bricks.json. Returns the CachedBrick which includes the resolved brick and local path.

Implementation

Future<CachedBrick> add(Brick brick) async {
  if (brick.location.path != null) {
    return _addLocalBrick(brick);
  }

  if (brick.location.git != null) {
    return _addRemoteBrickFromGit(brick);
  }

  return _addRemoteBrickFromRegistry(brick);
}