factor out Creds

This commit is contained in:
Joey Hess 2012-11-14 19:32:27 -04:00
parent c223e88d33
commit e250f6f11f
5 changed files with 157 additions and 107 deletions

View file

@ -116,7 +116,7 @@ getEnableS3R uuid = s3Configurator $ do
makeS3Remote :: S3Creds -> String -> (Remote -> Handler ()) -> RemoteConfig -> Handler ()
makeS3Remote (S3Creds ak sk) name setup config = do
remotename <- runAnnex name $ fromRepo $ uniqueRemoteName name 0
liftIO $ S3.s3SetCredsEnv ( T.unpack ak, T.unpack sk)
liftIO $ S3.s3SetCredsEnv (T.unpack ak, T.unpack sk)
r <- liftAssistant $ liftAnnex $ addRemote $ do
makeSpecialRemote name S3.remote config
return remotename