git-annex/Command/Init.hs

35 lines
753 B
Haskell
Raw Normal View History

{- git-annex command
-
- Copyright 2010 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Init where
2011-10-05 20:02:51 +00:00
import Common.Annex
import Command
2014-01-26 20:36:31 +00:00
import Annex.Init
import qualified Annex.SpecialRemote
cmd :: Command
cmd = dontCheck repoExists $
command "init" SectionSetup "initialize git-annex"
paramDesc (withParams seek)
seek :: CmdParams -> CommandSeek
seek = withWords start
2010-11-11 22:54:52 +00:00
start :: [String] -> CommandStart
start ws = do
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
perform :: String -> CommandPerform
perform description = do
initialize $ if null description then Nothing else Just description
Annex.SpecialRemote.autoEnable
next $ return True