move commandAction out of CmdLine.Seek
This is groundwork for nested seek loops, eg seeking over all files and then performing commandActions on a list of remotes, which can be done concurrently. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
This commit is contained in:
parent
47707608b1
commit
53526136e8
80 changed files with 169 additions and 156 deletions
|
@ -44,8 +44,8 @@ seek o = allowConcurrentOutput $ do
|
|||
case batchOption o of
|
||||
Batch fmt -> batchFilesMatching fmt go
|
||||
NoBatch -> withKeyOptions (keyOptions o) (autoMode o)
|
||||
(startKeys from)
|
||||
(withFilesInGit go)
|
||||
(commandAction . startKeys from)
|
||||
(withFilesInGit (commandAction . go))
|
||||
=<< workTreeItems (getFiles o)
|
||||
|
||||
start :: GetOptions -> Maybe Remote -> FilePath -> Key -> CommandStart
|
||||
|
@ -57,8 +57,8 @@ start o from file key = start' expensivecheck from key afile (mkActionItem afile
|
|||
<||> wantGet False (Just key) afile
|
||||
| otherwise = return True
|
||||
|
||||
startKeys :: Maybe Remote -> Key -> ActionItem -> CommandStart
|
||||
startKeys from key ai = checkFailedTransferDirection ai Download $
|
||||
startKeys :: Maybe Remote -> (Key, ActionItem) -> CommandStart
|
||||
startKeys from (key, ai) = checkFailedTransferDirection ai Download $
|
||||
start' (return True) from key (AssociatedFile Nothing) ai
|
||||
|
||||
start' :: Annex Bool -> Maybe Remote -> Key -> AssociatedFile -> ActionItem -> CommandStart
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue