summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-16 00:05:17 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-16 00:05:49 -0400
commite7aaa55c53fb54c6dd5a1a1aeb0955b05227676b (patch)
treefbdea0a0d9f9ec7b74800031767963bf4adc60aa
parent7d1c09fe4a4b54b68c7a446659cc6b7f6cec7252 (diff)
create parent directories as needed for addurl --file
-rw-r--r--Command/AddUrl.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index f91d6dd55..e23f4262b 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -46,8 +46,7 @@ perform :: String -> FilePath -> CommandPerform
perform url file = ifAnnexed file addurl geturl
where
geturl = do
- whenM (liftIO $ doesFileExist file) $
- error $ "not overwriting existing " ++ file
+ liftIO $ createDirectoryIfMissing True (parentDir file)
fast <- Annex.getState Annex.fast
if fast then nodownload url file else download url file
addurl (key, _backend) = do