use ShellParam type
So, I have a type checked safe handling of filenames starting with dashes, throughout the code.
This commit is contained in:
parent
7e5678bcf7
commit
fcdc4797a9
24 changed files with 151 additions and 124 deletions
|
@ -32,7 +32,7 @@ backend = Backend.File.backend {
|
|||
sha1 :: FilePath -> Annex String
|
||||
sha1 file = do
|
||||
showNote "checksum..."
|
||||
liftIO $ pOpen ReadFromPipe "sha1sum" [utilityEscape file] $ \h -> do
|
||||
liftIO $ pOpen ReadFromPipe "sha1sum" (toShell [File file]) $ \h -> do
|
||||
line <- hGetLine h
|
||||
let bits = split " " line
|
||||
if null bits
|
||||
|
|
|
@ -51,6 +51,6 @@ downloadUrl :: Key -> FilePath -> Annex Bool
|
|||
downloadUrl key file = do
|
||||
showNote "downloading"
|
||||
showProgress -- make way for curl progress bar
|
||||
liftIO $ boolSystem "curl" ["-#", "-o", utilityEscape file, url]
|
||||
liftIO $ boolSystem "curl" [Params "-# -o", File file, File url]
|
||||
where
|
||||
url = join ":" $ drop 1 $ split ":" $ show key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue