2010-11-02 23:04:24 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Init where
|
|
|
|
|
2011-10-05 20:02:51 +00:00
|
|
|
import Common.Annex
|
2010-11-02 23:04:24 +00:00
|
|
|
import Command
|
2011-08-17 18:14:43 +00:00
|
|
|
import Init
|
2010-12-30 19:06:26 +00:00
|
|
|
|
2011-10-29 19:19:05 +00:00
|
|
|
def :: [Command]
|
|
|
|
def = [dontCheck repoExists $
|
2013-03-24 22:28:21 +00:00
|
|
|
command "init" paramDesc seek SectionSetup "initialize git-annex"]
|
2010-11-02 23:04:24 +00:00
|
|
|
|
2010-12-30 18:19:16 +00:00
|
|
|
seek :: [CommandSeek]
|
2011-05-16 16:25:54 +00:00
|
|
|
seek = [withWords start]
|
2010-11-11 22:54:52 +00:00
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: [String] -> CommandStart
|
2011-05-16 16:25:54 +00:00
|
|
|
start ws = do
|
2010-11-02 23:04:24 +00:00
|
|
|
showStart "init" description
|
2011-05-15 06:02:46 +00:00
|
|
|
next $ perform description
|
2012-11-12 05:05:04 +00:00
|
|
|
where
|
|
|
|
description = unwords ws
|
2010-11-02 23:04:24 +00:00
|
|
|
|
2010-12-30 18:19:16 +00:00
|
|
|
perform :: String -> CommandPerform
|
2010-11-02 23:04:24 +00:00
|
|
|
perform description = do
|
2011-11-12 19:42:52 +00:00
|
|
|
initialize $ if null description then Nothing else Just description
|
2011-06-22 20:03:26 +00:00
|
|
|
next $ return True
|