From 31555e44d6331724b7ff37617319cf1bf01eafb2 Mon Sep 17 00:00:00 2001 From: aviaviavi Date: Wed, 25 Jul 2018 21:02:53 -0700 Subject: [PATCH] allow empty asset list from github release response --- app/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index b8cd25e..0b3ca87 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -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 @@ -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 =