mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
creates correct icon file
This commit is contained in:
@@ -65,7 +65,6 @@ import Startlude ( ($)
|
|||||||
, filter
|
, filter
|
||||||
, find
|
, find
|
||||||
, for_
|
, for_
|
||||||
, fromMaybe
|
|
||||||
, headMay
|
, headMay
|
||||||
, not
|
, not
|
||||||
, partitionEithers
|
, partitionEithers
|
||||||
@@ -157,7 +156,11 @@ extractPkg fp = handle @_ @SomeException cleanup $ do
|
|||||||
liftIO . throwIO $ ManifestParseException (pkgRoot </> "manifest.json")
|
liftIO . throwIO $ ManifestParseException (pkgRoot </> "manifest.json")
|
||||||
Right manifest -> do
|
Right manifest -> do
|
||||||
wait iconTask
|
wait iconTask
|
||||||
let iconDest = "icon" <.> T.unpack (fromMaybe "png" (serviceManifestIcon manifest))
|
let iconDest = "icon" <.> case serviceManifestIcon manifest of
|
||||||
|
Nothing -> "png"
|
||||||
|
Just x -> case takeExtension (T.unpack x) of
|
||||||
|
"" -> "png"
|
||||||
|
other -> other
|
||||||
liftIO $ renameFile (pkgRoot </> "icon.tmp") (pkgRoot </> iconDest)
|
liftIO $ renameFile (pkgRoot </> "icon.tmp") (pkgRoot </> iconDest)
|
||||||
hash <- wait pkgHashTask
|
hash <- wait pkgHashTask
|
||||||
liftIO $ writeFile (pkgRoot </> "hash.bin") hash
|
liftIO $ writeFile (pkgRoot </> "hash.bin") hash
|
||||||
|
|||||||
Reference in New Issue
Block a user