Support checking ftp urls for file presence.
This commit is contained in:
parent
0b18228516
commit
cf786f42a4
3 changed files with 13 additions and 3 deletions
|
@ -123,10 +123,14 @@ getUrlInfo url uo = case parseURIRelaxed url of
|
|||
| Build.SysConfig.curl -> do
|
||||
output <- catchDefaultIO "" $
|
||||
readProcess "curl" $ toCommand curlparams
|
||||
let len = extractlencurl output
|
||||
let good = found len Nothing
|
||||
case lastMaybe (lines output) of
|
||||
Just ('2':_:_) -> found
|
||||
(extractlencurl output)
|
||||
Nothing
|
||||
Just ('2':_:_) -> good
|
||||
-- don't try to parse ftp status
|
||||
-- codes; if curl got a length,
|
||||
-- it's good
|
||||
_ | "ftp" `isInfixOf` uriScheme u && isJust len -> good
|
||||
_ -> dne
|
||||
| otherwise -> dne
|
||||
Nothing -> dne
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue