Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
NBull92 committed Oct 25, 2023
1 parent 0df7843 commit b0b7d91
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Squirrel/Sources/GitlabSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ public class GitlabReleaseLink

/// <summary>
/// The category type that the asset is listed under.
/// Examples: 'Packages', 'Runbook', 'Other'
/// Options: 'Package', 'Image', 'Runbook', 'Other'
/// </summary>
[DataMember(Name = "link_type")]
public string Type { get; set; }

}

/// <summary>
Expand Down Expand Up @@ -195,19 +194,24 @@ public async Task<ReleaseEntry[]> GetReleaseFeed(Guid? stagingId = null, Release
/// </summary>
protected virtual string GetAssetUrlFromName(GitlabRelease release, string assetName)
{
if (release.Assets == null || release.Assets.Count == 0) {
if (release.Assets == null || release.Assets.Count == 0)
{
throw new ArgumentException($"No assets found in Github Release '{release.Name}'.");
}

GitlabReleaseLink packageFile =
release.Assets.Links.FirstOrDefault(a => a.Name.Equals(assetName, StringComparison.InvariantCultureIgnoreCase));
if (packageFile == null) {
if (packageFile == null)
{
throw new ArgumentException($"Could not find asset called '{assetName}' in GitLab Release '{release.Name}'.");
}

if (String.IsNullOrWhiteSpace(AccessToken)) {
if (String.IsNullOrWhiteSpace(AccessToken))
{
return packageFile.DirectAssetUrl;
} else {
}
else
{
return packageFile.Url;
}
}
Expand Down

0 comments on commit b0b7d91

Please sign in to comment.