diff --git a/src/Server.hs b/src/Server.hs index 3d7ef17..beeb071 100644 --- a/src/Server.hs +++ b/src/Server.hs @@ -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) @@ -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