diff --git a/src/Handler/Apps.hs b/src/Handler/Apps.hs index acdeac4..575461f 100644 --- a/src/Handler/Apps.hs +++ b/src/Handler/Apps.hs @@ -21,10 +21,8 @@ import System.Directory import Yesod.Core import Foundation -import Handler.Types.Status import Lib.Registry import Lib.Semver -import Lib.Types.Semver import System.FilePath ((<.>)) import System.Posix.Files (fileSize, getFileStatus) diff --git a/src/Handler/Types/Status.hs b/src/Handler/Types/Status.hs index 2de51ad..e37be56 100644 --- a/src/Handler/Types/Status.hs +++ b/src/Handler/Types/Status.hs @@ -5,8 +5,6 @@ module Handler.Types.Status where import Startlude import Data.Aeson -import Data.Char -import qualified Data.Text as T import Yesod.Core.Content import Lib.Types.Semver @@ -31,9 +29,3 @@ instance ToContent (Maybe AppVersionRes) where toContent = toContent . toJSON instance ToTypedContent (Maybe AppVersionRes) where toTypedContent = toTypedContent . toJSON - --- querySpec :: Text -> Maybe AppVersionSpecification --- querySpec = readMaybe . toS . T.filter (not . isSpace) - --- querySpecD :: AppVersionSpecification -> Maybe Text -> AppVersionSpecification --- querySpecD defaultSpec = fromMaybe defaultSpec . querySpec diff --git a/src/Lib/Semver.hs b/src/Lib/Semver.hs index bb78134..16786ff 100644 --- a/src/Lib/Semver.hs +++ b/src/Lib/Semver.hs @@ -5,6 +5,7 @@ import Startlude import Lib.Types.Semver (<||) :: HasAppVersion a => a -> AppVersionSpecification -> Bool +(<||) a AppVersionAny = True (<||) a (AppVersionSpecification SVEquals av1) = version a == av1 (<||) a (AppVersionSpecification SVLessThan av1) = version a < av1 (<||) a (AppVersionSpecification SVGreaterThan av1) = version a > av1