@@ -23,18 +23,18 @@ cabal = command1_ "cabal" []
2323
2424main :: IO ()
2525main = do
26- Options {optionsConfig} <- parseOptions
26+ Options {optionsConfig, optionsKeys } <- parseOptions
2727
2828 eConfig <- readConfig optionsConfig
2929
3030 case eConfig of
3131 Left e ->
3232 hPutStrLn stderr e
3333 Right config ->
34- makeRepository (configSources config)
34+ makeRepository (configSources config) optionsKeys
3535
36- makeRepository :: MonadIO m => [Source ] -> m ()
37- makeRepository sources = shelly $ do
36+ makeRepository :: MonadIO m => [Source ] -> FilePath -> m ()
37+ makeRepository sources keysPath = shelly $ do
3838 outDir <- absPath " _repo"
3939 idxDir <- absPath " _repo/index"
4040 pkgDir <- absPath " _repo/package"
@@ -44,7 +44,7 @@ makeRepository sources = shelly $ do
4444 mkdir outDir
4545 mkdir pkgDir
4646
47- keysDir <- absPath " _keys "
47+ keysDir <- absPath keysPath
4848 ensureKeys keysDir
4949
5050 forM_ sources $ processSource pkgDir
@@ -89,15 +89,8 @@ ensureKeys keysDir = do
8989 if b
9090 then echo $ " Using existing keys in " <> toTextIgnore keysDir
9191 else do
92- mKeys <- get_env " KEYS"
93- case mKeys of
94- Just _keys -> do
95- echo " Using keys from environment"
96- mkdir keysDir
97- bash_ (" echo \" $KEYS\" | base64 -d | tar xvz -C " <> keysDir) []
98- Nothing -> do
99- echo $ " Creating new repository keys in " <> toTextIgnore keysDir
100- liftIO $ createKeys keysDir
92+ echo $ " Creating new repository keys in " <> toTextIgnore keysDir
93+ liftIO $ createKeys keysDir
10194
10295processSource :: FilePath -> Source -> Sh ()
10396processSource pkgDir (Source url subdirs) = do
0 commit comments