summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJavran Cheng <Javran.c@gmail.com>2015-09-24 15:26:01 -0400
committerJavran Cheng <Javran.c@gmail.com>2015-09-24 15:26:01 -0400
commit5b36fea95cc94975d67067a3d01c92c7f49098dd (patch)
treee2baa0a3ca8eccdaf610e9555a59fc90bf083cea /src
parentbbacb450761ef7017a4a86a104ca5464f7240343 (diff)
downloadhakyll-5b36fea95cc94975d67067a3d01c92c7f49098dd.tar.gz
prevent "-h" or "--help" from generating dir
assume user in general is not expecting "--something" directory to be generated.
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Init.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Hakyll/Init.hs b/src/Hakyll/Init.hs
index 9d90f31..816ef43 100644
--- a/src/Hakyll/Init.hs
+++ b/src/Hakyll/Init.hs
@@ -9,7 +9,7 @@ import Control.Arrow (first)
import Control.Monad (forM_)
import Data.Char (isAlphaNum, isNumber)
import Data.List (foldl')
-import Data.List (intercalate)
+import Data.List (intercalate, isPrefixOf)
import Data.Version (Version (..))
import System.Directory (canonicalizePath, copyFile)
import System.Environment (getArgs, getProgName)
@@ -31,7 +31,7 @@ main = do
files <- getRecursiveContents (const $ return False) srcDir
case args of
- [dstDir] -> do
+ [dstDir] | not ("-" `isPrefixOf` dstDir) -> do
forM_ files $ \file -> do
let dst = dstDir </> file
src = srcDir </> file