Skip to content

Commit

Permalink
Merge pull request #1 from ulidtko/master
Browse files Browse the repository at this point in the history
add CWD in server status output
  • Loading branch information
mvoidex committed Nov 24, 2014
2 parents cd380a7 + 1b9557a commit 381c1aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Control.Monad (guard)
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import GHC.IO.Exception (IOErrorType(ResourceVanished))
import Network (Socket, accept, listenOn, sClose)
import System.Directory (removeFile)
import System.Directory (removeFile, getCurrentDirectory)
import System.Exit (ExitCode(ExitSuccess))
import System.IO (Handle, hClose, hFlush, hGetLine, hPutStrLn)
import System.IO.Error (ioeGetErrorType, isDoesNotExistError)
Expand Down Expand Up @@ -75,8 +75,10 @@ getNextCommand currentClient sock = do
Just (SrvCommand cmd ghcOpts) -> do
return $ Just (cmd, ghcOpts)
Just SrvStatus -> do
cwd <- getCurrentDirectory
mapM_ (clientSend currentClient) $
[ ClientStdout "Server is running."
, ClientStdout ("Server CWD is " ++ cwd)
, ClientExit ExitSuccess
]
getNextCommand currentClient sock
Expand Down

0 comments on commit 381c1aa

Please sign in to comment.