summaryrefslogtreecommitdiff
path: root/devel.hs
diff options
context:
space:
mode:
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