mirror of
https://github.com/Start9Labs/registry.git
synced 2026-04-01 04:33:39 +00:00
more cleanup
This commit is contained in:
@@ -48,7 +48,6 @@ import Startlude ( ($)
|
||||
, (&&)
|
||||
, (.)
|
||||
, (<$>)
|
||||
, (<>)
|
||||
, Bool(..)
|
||||
, ByteString
|
||||
, Down(..)
|
||||
@@ -234,7 +233,7 @@ getIcon pkg version = do
|
||||
let pkgRoot = root </> show pkg </> show version
|
||||
mIconFile <- find ((== "icon") . takeBaseName) <$> listDirectory pkgRoot
|
||||
case mIconFile of
|
||||
Nothing -> throwIO $ NotFoundE $ show pkg <> ": Icon"
|
||||
Nothing -> throwIO $ NotFoundE $ [i|#{pkg}: Icon|]
|
||||
Just x -> do
|
||||
let ct = case takeExtension x of
|
||||
".png" -> typePng
|
||||
|
||||
@@ -49,7 +49,7 @@ instance ToJSONKey PkgId where
|
||||
instance PersistField PkgId where
|
||||
toPersistValue = PersistText . show
|
||||
fromPersistValue (PersistText t) = Right . PkgId $ toS t
|
||||
fromPersistValue other = Left $ "Invalid AppId: " <> show other
|
||||
fromPersistValue other = Left $ [i|Invalid AppId: #{other}|]
|
||||
instance PersistFieldSql PkgId where
|
||||
sqlType _ = SqlString
|
||||
instance PathPiece PkgId where
|
||||
|
||||
Reference in New Issue
Block a user