diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-31 16:46:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-31 17:22:55 -0400 |
commit | 3d2a9f84051e9dc705ba4bb4828af691e479ae0e (patch) | |
tree | f99ff17d8fa860d1dcf2c8ebd8552e1e80bda8b3 /Command/AddUrl.hs | |
parent | 00988bcf369671bdc3b78e95e3c2ae43f4835b1c (diff) |
cleanup
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r-- | Command/AddUrl.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 4382a9c07..b717e271d 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -26,15 +26,14 @@ seek :: [CommandSeek] seek = [withStrings start] start :: String -> CommandStart -start s = notBareRepo $ do - let u = parseURI s - case u of - Nothing -> error $ "bad url " ++ s - Just url -> do +start s = notBareRepo $ go $ parseURI s + where + go Nothing = error $ "bad url " ++ s + go (Just url) = do file <- liftIO $ url2file url showStart "addurl" file next $ perform s file - + perform :: String -> FilePath -> CommandPerform perform url file = do fast <- Annex.getState Annex.fast @@ -64,7 +63,6 @@ nodownload :: String -> FilePath -> CommandPerform nodownload url file = do let key = Backend.URL.fromUrl url setUrlPresent key url - next $ Command.Add.cleanup file key False url2file :: URI -> IO FilePath |