aboutsummaryrefslogtreecommitdiff
path: root/Command/RemoteDaemon.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-06 19:06:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-06 19:10:23 -0400
commit8c4bfe2f2141bce84ea22120da445c148b6f1168 (patch)
tree817f5951cec02c1acec3f26c886beea79cf0957c /Command/RemoteDaemon.hs
parent1eb96cc31a0f0ec0339f6b28a362b057444069af (diff)
added git-annex remotedaemon
So far, handling connecting to git-annex-shell notifychanges, and pulling immediately when a change is pushed to a remote. A little bit buggy (crashes after the first pull), but it already works! This commit was sponsored by Mark Sheppard.
Diffstat (limited to 'Command/RemoteDaemon.hs')
-rw-r--r--Command/RemoteDaemon.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Command/RemoteDaemon.hs b/Command/RemoteDaemon.hs
new file mode 100644
index 000000000..61c3a7d84
--- /dev/null
+++ b/Command/RemoteDaemon.hs
@@ -0,0 +1,24 @@
+{- git-annex command
+ -
+ - Copyright 2014 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Command.RemoteDaemon where
+
+import Common.Annex
+import Command
+import RemoteDaemon.Core
+
+def :: [Command]
+def = [noCommit $ command "remotedaemon" paramNothing seek SectionPlumbing
+ "detects when remotes have changed, and fetches from them"]
+
+seek :: CommandSeek
+seek = withNothing start
+
+start :: CommandStart
+start = do
+ liftIO runForeground
+ stop