mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
Apply suggestions from code review
Mostly removals of commented code.
This commit is contained in:
@@ -343,7 +343,6 @@ getServiceDetails settings metadata maybeVersion pkg = do
|
|||||||
packageMetadata <- case HM.lookup pkg metadata of
|
packageMetadata <- case HM.lookup pkg metadata of
|
||||||
Nothing -> throwIO $ NotFoundE [i|#{pkg} not found.|]
|
Nothing -> throwIO $ NotFoundE [i|#{pkg} not found.|]
|
||||||
Just m -> pure m
|
Just m -> pure m
|
||||||
-- let (appsDir, appMgrDir) = ((</> "apps") . resourcesDir &&& staticBinDir) settings
|
|
||||||
let domain = registryHostname settings
|
let domain = registryHostname settings
|
||||||
version <- case maybeVersion of
|
version <- case maybeVersion of
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
@@ -352,8 +351,6 @@ getServiceDetails settings metadata maybeVersion pkg = do
|
|||||||
[] -> throwIO $ NotFoundE $ "no latest version found for " <> show pkg
|
[] -> throwIO $ NotFoundE $ "no latest version found for " <> show pkg
|
||||||
x : _ -> pure x
|
x : _ -> pure x
|
||||||
Just v -> pure v
|
Just v -> pure v
|
||||||
-- let appDir = (<> "/") . (</> show version) . (</> show appId) $ appsDir
|
|
||||||
-- let appExt = Extension (show appId) :: Extension "s9pk"
|
|
||||||
manifest <- flip runReaderT settings $ (snd <$> getManifest pkg version) >>= \bs ->
|
manifest <- flip runReaderT settings $ (snd <$> getManifest pkg version) >>= \bs ->
|
||||||
runConduit $ bs .| CL.foldMap BS.fromStrict
|
runConduit $ bs .| CL.foldMap BS.fromStrict
|
||||||
case eitherDecode manifest of
|
case eitherDecode manifest of
|
||||||
@@ -393,13 +390,7 @@ mapDependencyMetadata domain metadata (appId, depInfo) = do
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
-- decodeInstructions :: (MonadUnliftIO m, MonadHandler m, MonadThrow m) => FilePath -> FilePath -> S9PK -> m Text
|
|
||||||
-- decodeInstructions appmgrPath depPath package = do
|
|
||||||
-- sourceInstructions appmgrPath depPath package (\bs -> sinkMem (bs .| CT.decode CT.utf8))
|
|
||||||
|
|
||||||
-- decodeLicense :: (MonadUnliftIO m, MonadThrow m, MonadHandler m) => FilePath -> FilePath -> S9PK -> m Text
|
|
||||||
-- decodeLicense appmgrPath depPath package =
|
|
||||||
-- sourceLicense appmgrPath depPath package (\bs -> sinkMem (bs .| CT.decode CT.utf8))
|
|
||||||
|
|
||||||
fetchAllAppVersions :: Key SApp -> HandlerFor RegistryCtx ([VersionInfo], ReleaseNotes)
|
fetchAllAppVersions :: Key SApp -> HandlerFor RegistryCtx ([VersionInfo], ReleaseNotes)
|
||||||
fetchAllAppVersions appId = do
|
fetchAllAppVersions appId = do
|
||||||
|
|||||||
1
src/Lib/External/AppMgr.hs
vendored
1
src/Lib/External/AppMgr.hs
vendored
@@ -65,6 +65,7 @@ readProcessInheritStderr a b c sink = do
|
|||||||
$ System.Process.Typed.proc a b
|
$ System.Process.Typed.proc a b
|
||||||
withProcessTerm' pc $ \p -> sink (getStdout p)
|
withProcessTerm' pc $ \p -> sink (getStdout p)
|
||||||
where
|
where
|
||||||
|
-- We need this to deal with https://github.com/haskell/process/issues/215
|
||||||
withProcessTerm' :: (MonadUnliftIO m)
|
withProcessTerm' :: (MonadUnliftIO m)
|
||||||
=> ProcessConfig stdin stdout stderr
|
=> ProcessConfig stdin stdout stderr
|
||||||
-> (Process stdin stdout stderr -> m a)
|
-> (Process stdin stdout stderr -> m a)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import System.FilePath ( (</>) )
|
|||||||
import Yesod.Default.Config2 ( configSettingsYml )
|
import Yesod.Default.Config2 ( configSettingsYml )
|
||||||
|
|
||||||
import Control.Monad.Reader.Has ( Has(extract, update) )
|
import Control.Monad.Reader.Has ( Has(extract, update) )
|
||||||
import Lib.PkgRepository ( PkgRepo(PkgRepo, pkgRepoAppMgrBin, pkgRepoFileRoot) )
|
import Lib.PkgRepository ( PkgRepo(..) )
|
||||||
import Lib.Types.Emver
|
import Lib.Types.Emver
|
||||||
import Orphans.Emver ( )
|
import Orphans.Emver ( )
|
||||||
-- | Runtime settings to configure this application. These settings can be
|
-- | Runtime settings to configure this application. These settings can be
|
||||||
|
|||||||
@@ -133,6 +133,4 @@ spec = do
|
|||||||
app <- runDBtest $ insert $ SApp time Nothing "Bitcoin Core" "bitcoin" "short desc" "long desc" "png"
|
app <- runDBtest $ insert $ SApp time Nothing "Bitcoin Core" "bitcoin" "short desc" "long desc" "png"
|
||||||
_ <- runDBtest $ insert $ SVersion time Nothing app "0.19.0.0" "release notes 0.19.0.0" Any Any Nothing
|
_ <- runDBtest $ insert $ SVersion time Nothing app "0.19.0.0" "release notes 0.19.0.0" Any Any Nothing
|
||||||
_ <- runDBtest $ insert $ SVersion time Nothing app "0.20.0.0" "release notes 0.19.0.0" Any Any Nothing
|
_ <- runDBtest $ insert $ SVersion time Nothing app "0.20.0.0" "release notes 0.19.0.0" Any Any Nothing
|
||||||
-- res <- runDBtest $ getServiceVersionsWithReleaseNotes "bitcoin"
|
|
||||||
-- print res
|
|
||||||
print ()
|
print ()
|
||||||
|
|||||||
Reference in New Issue
Block a user