Skip to content

Commit

Permalink
allow empty asset list from github release response
Browse files Browse the repository at this point in the history
  • Loading branch information
aviaviavi committed Jul 26, 2018
1 parent 5aa0858 commit 31555e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ instance FromJSON GithubReleaseAsset

-- | The json response we expect from github when we check for the latest release
data GithubRelease = GithubRelease
{ assets :: NE.NonEmpty GithubReleaseAsset
{ assets :: [GithubReleaseAsset]
, tag_name :: T.Text -- snake case because that's what we get back from github
} deriving (Show, Generic)
instance FromJSON GithubRelease
Expand Down Expand Up @@ -94,8 +94,8 @@ runFile path verbosityLevel regexp = do

-- | If we're on mac, we want a *-mac tarball from the releases page. If we're on linux we
-- do not
filterAsset :: NE.NonEmpty GithubReleaseAsset -> Maybe GithubReleaseAsset
filterAsset assetList = find filterFn $ NE.toList assetList
filterAsset :: [GithubReleaseAsset] -> Maybe GithubReleaseAsset
filterAsset assetList = find filterFn assetList
where
filterFn' a = "mac" `T.isInfixOf` Main.name a
filterFn =
Expand Down

0 comments on commit 31555e4

Please sign in to comment.