Commit 0da8888e authored by Henrik Tramberend's avatar Henrik Tramberend
Browse files

Fix creation of the public/support dir

parent 9db8c80a
...@@ -14,13 +14,16 @@ import External ...@@ -14,13 +14,16 @@ import External
import GHC.Conc (numCapabilities) import GHC.Conc (numCapabilities)
import Project import Project
import Resources import Resources
import System.Directory (copyFile) import System.Posix.Files
import System.Directory
(copyFile, doesDirectoryExist, createDirectoryIfMissing)
import System.FilePath () import System.FilePath ()
import qualified Text.Mustache as M () import qualified Text.Mustache as M ()
import Text.Pandoc () import Text.Pandoc ()
import Text.Printf () import Text.Printf ()
import qualified Text.Sass as Sass import qualified Text.Sass as Sass
import Utilities import Utilities
import Control.Monad.Extra
main :: IO () main :: IO ()
main = do main = do
...@@ -63,12 +66,12 @@ main = do ...@@ -63,12 +66,12 @@ main = do
phony "version" $ putNormal $ "decker version " ++ deckerVersion phony "version" $ putNormal $ "decker version " ++ deckerVersion
-- --
phony "decks" $ do phony "decks" $ do
decksA >>= need
need ["support"] need ["support"]
decksA >>= need
-- --
phony "html" $ do phony "html" $ do
everythingA <++> indexA >>= need
need ["support"] need ["support"]
everythingA <++> indexA >>= need
-- --
-- phony "pdf" $ pagesPdfA <++> handoutsPdfA <++> indexA >>= need -- phony "pdf" $ pagesPdfA <++> handoutsPdfA <++> indexA >>= need
-- --
...@@ -163,7 +166,6 @@ main = do ...@@ -163,7 +166,6 @@ main = do
"//*.css" %> \out -> do "//*.css" %> \out -> do
let src = out -<.> ".scss" let src = out -<.> ".scss"
exists <- doesFileExist src exists <- doesFileExist src
putNormal $ src ++ " exists: " ++ (show exists)
when exists $ do when exists $ do
need [src] need [src]
putNormal ("# scss (for " ++ makeRelativeTo projectDir out ++ ")") putNormal ("# scss (for " ++ makeRelativeTo projectDir out ++ ")")
...@@ -196,7 +198,11 @@ main = do ...@@ -196,7 +198,11 @@ main = do
everythingA <++> everythingPdfA >>= mapM_ putNormal everythingA <++> everythingPdfA >>= mapM_ putNormal
putNormal "" putNormal ""
-- --
phony "support" $ do liftIO $ writeResourceFiles "support" supportDir phony "support" $
liftIO $ do
unlessM (System.Directory.doesDirectoryExist supportDir) $ do
createDirectoryIfMissing True publicDir
createSymbolicLink (appDataDir </> "support") supportDir
-- --
phony "check" checkExternalPrograms phony "check" checkExternalPrograms
-- --
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment