@@ -23,18 +23,18 @@ cabal = command1_ "cabal" []
23
23
24
24
main :: IO ()
25
25
main = do
26
- Options {optionsConfig} <- parseOptions
26
+ Options {optionsConfig, optionsKeys } <- parseOptions
27
27
28
28
eConfig <- readConfig optionsConfig
29
29
30
30
case eConfig of
31
31
Left e ->
32
32
hPutStrLn stderr e
33
33
Right config ->
34
- makeRepository (configSources config)
34
+ makeRepository (configSources config) optionsKeys
35
35
36
- makeRepository :: MonadIO m => [Source ] -> m ()
37
- makeRepository sources = shelly $ do
36
+ makeRepository :: MonadIO m => [Source ] -> FilePath -> m ()
37
+ makeRepository sources keysPath = shelly $ do
38
38
outDir <- absPath " _repo"
39
39
idxDir <- absPath " _repo/index"
40
40
pkgDir <- absPath " _repo/package"
@@ -44,7 +44,7 @@ makeRepository sources = shelly $ do
44
44
mkdir outDir
45
45
mkdir pkgDir
46
46
47
- keysDir <- absPath " _keys "
47
+ keysDir <- absPath keysPath
48
48
ensureKeys keysDir
49
49
50
50
forM_ sources $ processSource pkgDir
@@ -89,15 +89,8 @@ ensureKeys keysDir = do
89
89
if b
90
90
then echo $ " Using existing keys in " <> toTextIgnore keysDir
91
91
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
101
94
102
95
processSource :: FilePath -> Source -> Sh ()
103
96
processSource pkgDir (Source url subdirs) = do
0 commit comments