use copyFile (supports binary icon file)

This commit is contained in:
Joey Hess 2012-09-23 12:24:46 -04:00
parent 52b2fbd121
commit 377636850e

View file

@ -99,9 +99,10 @@ installOSXAppFile appdir appfile mcontent = do
( return $ "/Applications" </> appdir </> appfile
, return $ home </> "Desktop" </> appdir </> appfile
)
content <- maybe (readFile src) return mcontent
createDirectoryIfMissing True (parentDir dest)
writeFile dest content
case mcontent of
Just content -> writeFile dest content
Nothing -> copyFile src dest
mode <- fileMode <$> getFileStatus src
setFileMode dest mode