From 62597317839c7945bfbc4b7a00f55d2db6459ab6 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Fri, 24 Apr 2015 12:53:02 -0400 Subject: Finally put pfifcontractors into git --- devel.hs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 devel.hs (limited to 'devel.hs') 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 -- cgit v1.2.3