summaryrefslogtreecommitdiff
path: root/devel.hs
diff options
context:
space:
mode:
authorClint Adams <clint@softwarefreedom.org>2015-04-24 12:53:02 -0400
committerClint Adams <clint@softwarefreedom.org>2015-04-24 12:53:02 -0400
commit62597317839c7945bfbc4b7a00f55d2db6459ab6 (patch)
tree6ad8c079d5eea66b05326d435e30cc2b1de43266 /devel.hs
Finally put pfifcontractors into gitHEADmaster
Diffstat (limited to 'devel.hs')
-rw-r--r--devel.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/devel.hs b/devel.hs
new file mode 100644
index 0000000..98b376e
--- /dev/null
+++ b/devel.hs
@@ -0,0 +1,26 @@
+{-# LANGUAGE PackageImports #-}
+import "pfifcontractors" Application (getApplicationDev)
+import Network.Wai.Handler.Warp
+ (runSettings, defaultSettings, settingsPort)
+import Control.Concurrent (forkIO)
+import System.Directory (doesFileExist, removeFile)
+import System.Exit (exitSuccess)
+import Control.Concurrent (threadDelay)
+
+main :: IO ()
+main = do
+ putStrLn "Starting devel application"
+ (port, app) <- getApplicationDev
+ forkIO $ runSettings defaultSettings
+ { settingsPort = port
+ } app
+ loop
+
+loop :: IO ()
+loop = do
+ threadDelay 100000
+ e <- doesFileExist "dist/devel-terminate"
+ if e then terminateDevel else loop
+
+terminateDevel :: IO ()
+terminateDevel = exitSuccess