-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.hs
30 lines (25 loc) · 794 Bytes
/
deploy.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env stack
-- stack --package directory-tree --package Turtle .\deploy.hs
{-# LANGUAGE OverloadedStrings #-}
-- RUN with stack runghc deploy.hs
-- TODO:
-- directory-tree not needed
-- add command-line parser and deploy to GitHub options
import System.Directory.Tree
import Turtle
import System.FilePath
main = do
dir <- pwd
when (filename dir /= "jarnaldich.github.com") (die "Must be run from git root")
cptree "./_site" "."
rmtree "./drafts"
shell "git status" empty
-- Copy the site blog
-- To just print the structure for debugging
-- (site :/ t) <- readDirectoryWith return "./_site/"
-- print t
-- (site :/ t) <- readDirectory "./_site/"
-- res <- writeDirectory (".." :/ t)
-- return ()
-- let failed = anyFailed t
-- if not failed then