mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-30 03:41:57 +00:00
small fixes
This commit is contained in:
@@ -72,8 +72,8 @@ getEmbassyOsVersion = userAgentOsVersion
|
|||||||
getAppsManifestR :: Handler TypedContent
|
getAppsManifestR :: Handler TypedContent
|
||||||
getAppsManifestR = do
|
getAppsManifestR = do
|
||||||
osVersion <- getEmbassyOsVersion
|
osVersion <- getEmbassyOsVersion
|
||||||
appResourceFile <- (</> "apps" </> "apps.yaml") . resourcesDir . appSettings <$> getYesod
|
|
||||||
appsDir <- (</> "apps") . resourcesDir . appSettings <$> getYesod
|
appsDir <- (</> "apps") . resourcesDir . appSettings <$> getYesod
|
||||||
|
let appResourceFile = appsDir </> "apps.yaml"
|
||||||
manifest <- liftIO (Yaml.decodeFileEither appResourceFile) >>= \case
|
manifest <- liftIO (Yaml.decodeFileEither appResourceFile) >>= \case
|
||||||
Left e -> do
|
Left e -> do
|
||||||
$logError "COULD NOT PARSE APP INDEX! CORRECT IMMEDIATELY!"
|
$logError "COULD NOT PARSE APP INDEX! CORRECT IMMEDIATELY!"
|
||||||
@@ -94,10 +94,9 @@ getAppsManifestR = do
|
|||||||
(v, _) <- case mostRecentVersion of
|
(v, _) <- case mostRecentVersion of
|
||||||
Nothing -> notFound
|
Nothing -> notFound
|
||||||
Just a -> pure $ unRegisteredAppVersion a
|
Just a -> pure $ unRegisteredAppVersion a
|
||||||
maybeStoreApp <- liftIO $ addFileTimestamp dir ext service v
|
liftIO (addFileTimestamp dir ext service v) >>= \case
|
||||||
case maybeStoreApp of
|
Nothing -> notFound
|
||||||
Nothing -> notFound
|
Just appWithTimestamp -> pure (appId, appWithTimestamp)
|
||||||
Just appWithTimestamp -> pure (appId, appWithTimestamp)
|
|
||||||
|
|
||||||
getSysR :: Extension "" -> Handler TypedContent
|
getSysR :: Extension "" -> Handler TypedContent
|
||||||
getSysR e = do
|
getSysR e = do
|
||||||
@@ -106,9 +105,7 @@ getSysR e = do
|
|||||||
|
|
||||||
getAppManifestR :: AppIdentifier -> Handler TypedContent
|
getAppManifestR :: AppIdentifier -> Handler TypedContent
|
||||||
getAppManifestR appId = do
|
getAppManifestR appId = do
|
||||||
appSettings' <- appSettings <$> getYesod
|
(appsDir, appMgrDir) <- getsYesod $ ((</> "apps") . resourcesDir &&& staticBinDir) . appSettings
|
||||||
let appsDir = (</> "apps") . resourcesDir $ appSettings'
|
|
||||||
let appMgrDir = staticBinDir appSettings'
|
|
||||||
av <- getVersionFromQuery appsDir appExt >>= \case
|
av <- getVersionFromQuery appsDir appExt >>= \case
|
||||||
Nothing -> sendResponseStatus status400 ("Specified App Version Not Found" :: Text)
|
Nothing -> sendResponseStatus status400 ("Specified App Version Not Found" :: Text)
|
||||||
Just v -> pure v
|
Just v -> pure v
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import qualified Data.List.NonEmpty as NE
|
|||||||
|
|
||||||
import Lib.Types.Emver
|
import Lib.Types.Emver
|
||||||
import Orphans.Emver ( )
|
import Orphans.Emver ( )
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import Lib.Registry
|
import Lib.Registry
|
||||||
|
|
||||||
type AppIdentifier = Text
|
type AppIdentifier = Text
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user