diff options
| author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-11-22 18:07:33 +0000 |
|---|---|---|
| committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-11-22 18:07:33 +0000 |
| commit | 81c3bd6a54bc4cc878446af5a932be2e49c5a788 (patch) | |
| tree | 6f2c3768c80a852cd1b0ce02c5efe1324cbddcce | |
| parent | 4c387a4bc755ea3531787e2e51a6b83a9473259e (diff) | |
| download | pandoc-81c3bd6a54bc4cc878446af5a932be2e49c5a788.tar.gz | |
Modified markdown2pdf so as not to create a backup file.
Resolves Issue #166.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1624 788f1e2b-df1e-0410-8736-df70ead52e1b
| -rwxr-xr-x | markdown2pdf | 12 | ||||
| -rw-r--r-- | src/markdown2pdf.hs | 9 |
2 files changed, 3 insertions, 18 deletions
diff --git a/markdown2pdf b/markdown2pdf index ab0f3ae78..faeafc174 100755 --- a/markdown2pdf +++ b/markdown2pdf @@ -125,16 +125,6 @@ fi done ) || exit $? -is_target_exists= -if [ -f "$destname" ]; then - is_target_exists=1 - mv "$destname" "$destname~" -fi - mv -f $THIS_TEMPDIR/$texname.pdf "$destname" -errn "Created $destname" -[ -z "$is_target_exists" ] || { - errn " (previous file has been backed up as $destname~)" -} -err . +err "Created $destname" diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index 038549180..79cd09a2d 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -3,7 +3,7 @@ module Main where import Data.List (isInfixOf, intercalate, isPrefixOf) import Data.Maybe (isNothing) -import Control.Monad (when, unless, guard) +import Control.Monad (unless, guard) import Control.Exception (tryJust, bracket) import System.IO (stderr) @@ -129,13 +129,8 @@ saveStdin file = do saveOutput :: FilePath -> FilePath -> IO () saveOutput input output = do - outputExist <- doesFileExist output - when outputExist $ do - let output' = output ++ "~" - renameFile output output' - putStrLn $! "Created backup file " ++ output' copyFile input output - putStrLn $! "Created " ++ output + hPutStrLn stderr $! "Created " ++ output main :: IO () main = bracket |
