addAsset function

void addAsset(
  1. SimpleGitHub ghr,
  2. Release release, {
  3. required String assetPath,
  4. String? mimeType,
})

Uploads the file at assetPath to git hub against the given release. If mimeType is not supplied then the extension of the assetPath is used to determine the mimeType.

Implementation

void addAsset(SimpleGitHub ghr, ghub.Release release,
    {required String assetPath, String? mimeType}) {
  mimeType ??= lookupMimeType(assetPath);

  print('Sending Asset  $assetPath mimeType: $mimeType');
  ghr.attachAssetFromFile(
    release: release,
    assetPath: assetPath,
    assetName: basename(assetPath),
    mimeType: mimeType!,
  );
}