mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-30 19:51:51 -07:00
X.Prelude: Add mkAbsolutePath
This commit is contained in:
@@ -57,7 +57,6 @@ import XMonad.Util.Parser
|
||||
import XMonad.Util.XSelection (getSelection)
|
||||
|
||||
import Data.Time (Day (ModifiedJulianDay), NominalDiffTime, UTCTime (utctDay), addUTCTime, defaultTimeLocale, formatTime, fromGregorian, getCurrentTime, iso8601DateFormat, nominalDay, toGregorian)
|
||||
import System.Directory (getHomeDirectory)
|
||||
import System.IO (IOMode (AppendMode), hPutStrLn, withFile)
|
||||
|
||||
{- $usage
|
||||
@@ -217,10 +216,7 @@ mkOrgPrompt xpc oc@OrgMode{ todoHeader, orgFile, clpSupport } =
|
||||
else Body $ "\n " <> sel
|
||||
|
||||
-- Expand path if applicable
|
||||
fp <- case orgFile of
|
||||
'/' : _ -> pure orgFile
|
||||
'~' : '/' : _ -> getHomeDirectory <&> (<> drop 1 orgFile)
|
||||
_ -> getHomeDirectory <&> (<> ('/' : orgFile))
|
||||
fp <- mkAbsolutePath orgFile
|
||||
|
||||
withFile fp AppendMode . flip hPutStrLn
|
||||
<=< maybe (pure "") (ppNote clpStr todoHeader) . pInput
|
||||
|
Reference in New Issue
Block a user