sim: add action repo sync command

This commit is contained in:
Joey Hess 2024-09-16 16:48:21 -04:00
parent 2cbd3fb26b
commit c420ec9364
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 23 additions and 8 deletions

View file

@ -55,6 +55,8 @@ generateSimFile = unlines . map unwords . go
["action", repo, "pull", remote] : go rest
go (CommandAction (RepoName repo) (ActionPush (RemoteName remote)) : rest) =
["action", repo, "push", remote] : go rest
go (CommandAction (RepoName repo) (ActionSync (RemoteName remote)) : rest) =
["action", repo, "sync", remote] : go rest
go (CommandAction (RepoName repo) (ActionGetWanted (RemoteName remote)) : rest) =
["action", repo, "getwanted", remote] : go rest
go (CommandAction (RepoName repo) (ActionDropUnwanted (Just (RemoteName remote))) : rest) =
@ -130,6 +132,9 @@ parseSimCommand ("action":repo:"pull":remote:[]) =
parseSimCommand ("action":repo:"push":remote:[]) =
Right $ CommandAction (RepoName repo)
(ActionPush (RemoteName remote))
parseSimCommand ("action":repo:"sync":remote:[]) =
Right $ CommandAction (RepoName repo)
(ActionSync (RemoteName remote))
parseSimCommand ("action":repo:"getwanted":remote:[]) =
Right $ CommandAction (RepoName repo)
(ActionGetWanted (RemoteName remote))