create parent directories as needed for addurl --file

This commit is contained in:
Joey Hess 2012-02-16 00:05:17 -04:00
parent 7d1c09fe4a
commit e7aaa55c53

View file

@ -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