Skip to content

Commit

Permalink
Remove commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Ravitch committed Jul 20, 2014
1 parent 9c863cc commit 656bf18
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/System/Taffybar/CommandRunner.hs
Expand Up @@ -29,7 +29,7 @@ import qualified System.Process as P
-- are displayed as string.
commandRunnerNew :: Double -- ^ Polling period (in seconds).
-> String -- ^ Command to execute. Should be in $PATH or an absolute path
-> [String] -- ^ Command argument. May be []
-> [String] -- ^ Command argument. May be @[]@
-> String -- ^ If command fails this will be displayed.
-> String -- ^ Output color
-> IO Gtk.Widget
Expand All @@ -46,29 +46,3 @@ runCommand cmd args defaultOutput color = do
return $ colorize color "" $ case ecode of
ExitSuccess -> stdout
ExitFailure _ -> defaultOutput
-- result <- readProcess cmd args []
-- return $ colorize color "" $ fromMaybe defaultOutput result
-- -- return $ colorize color "" $ case result of
-- -- Nothing -> defaultOutput
-- -- Just a -> a

-- readProcess :: FilePath -> [String] -> String -> IO (Maybe String) -- had to modify function from library
-- readProcess cmd args input = do
-- (Just inh, Just outh, _, pid) <-
-- P.createProcess (P.proc cmd args){ P.std_in = P.CreatePipe,
-- P.std_out = P.CreatePipe,
-- P.std_err = P.Inherit
-- }
-- output <- IO.hGetContents outh
-- outMVar <- C.newEmptyMVar
-- C.forkIO $ E.evaluate (length output) >> C.putMVar outMVar ()
-- when (not (null input)) $ do
-- IO.hPutStr inh input
-- IO.hFlush inh
-- IO.hClose inh
-- C.takeMVar outMVar
-- IO.hClose outh
-- ex <- P.waitForProcess pid
-- case ex of
-- ExitSuccess -> return $ Just output
-- ExitFailure _ -> return Nothing

0 comments on commit 656bf18

Please sign in to comment.