change XMonad.Prompt.AppendFile to use mkAbsolutePath

This commit is contained in:
brandon s allbery kf8nh
2022-08-20 12:01:42 -04:00
parent 64eb4e46ec
commit 2c5ea5f94a
2 changed files with 9 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ module XMonad.Prompt.AppendFile (
import XMonad.Core
import XMonad.Prompt
import XMonad.Prelude (mkAbsolutePath)
import System.IO
@@ -91,4 +92,4 @@ appendFilePrompt' c trans fn = mkXPrompt (AppendFile fn)
-- | Append a string to a file.
doAppend :: (String -> String) -> FilePath -> String -> X ()
doAppend trans fn = io . withFile fn AppendMode . flip hPutStrLn . trans
doAppend trans fn s = mkAbsolutePath fn >>= \f -> (io . withFile f AppendMode . flip hPutStrLn . trans) s