Added remote.name.annex-web-options configuration setting, which can be used to provide parameters to whichever of wget or curl git-annex uses (depends on which is available, but most of their important options suitable for use here are the same).
This commit is contained in:
parent
50ebfd265f
commit
aa0882691b
7 changed files with 36 additions and 13 deletions
|
@ -20,7 +20,8 @@ module Annex.Content (
|
|||
fromAnnex,
|
||||
moveBad,
|
||||
getKeysPresent,
|
||||
saveState
|
||||
saveState,
|
||||
downloadUrl,
|
||||
) where
|
||||
|
||||
import System.IO.Error (try)
|
||||
|
@ -36,6 +37,7 @@ import qualified Annex.Queue
|
|||
import qualified Annex.Branch
|
||||
import Utility.StatFS
|
||||
import Utility.FileMode
|
||||
import qualified Utility.Url as Url
|
||||
import Types.Key
|
||||
import Utility.DataUnits
|
||||
import Config
|
||||
|
@ -281,3 +283,10 @@ saveState :: Annex ()
|
|||
saveState = do
|
||||
Annex.Queue.flush False
|
||||
Annex.Branch.commit "update"
|
||||
|
||||
{- Downloads content from any of a list of urls. -}
|
||||
downloadUrl :: [Url.URLString] -> FilePath -> Annex Bool
|
||||
downloadUrl urls file = do
|
||||
g <- gitRepo
|
||||
o <- map Param . words <$> getConfig g "web-options" ""
|
||||
liftIO $ anyM (\u -> Url.download u o file) urls
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue