From 5a05dd033dc6c8ec5b72989f6cbbe4d8d0c07ceb Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Wed, 12 Jun 2019 13:32:35 +0800 Subject: [PATCH] Launch editor after entry command --- app/Main.hs | 2 ++ package.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/app/Main.hs b/app/Main.hs index 0146ae9..d68cc4c 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -14,6 +14,7 @@ import Data.Text hiding (intercalate, unlines, init, length) import Data.Time.Clock.POSIX import System.File.Tree hiding (mapM, mapM_) import System.Directory (doesFileExist) +import System.Process main :: IO () main = getArgs >>= parse @@ -65,6 +66,7 @@ entry = do let filename = "entries/" ++ (show entryNum) ++ "-" ++ (unpack . (toLower. replace " " "-") $ pack entryName) ++ ".txt" writeFile filename (show stamp ++ "::" ++ entryName ++ "\n") putStrLn $ "Created " ++ filename + callCommand $ "emacsclient " ++ filename ++ " &" usage :: IO () usage = putStr . ununlines $ [ diff --git a/package.yaml b/package.yaml index 966395a..71ad540 100644 --- a/package.yaml +++ b/package.yaml @@ -27,6 +27,7 @@ dependencies: - template - json - filesystem-trees +- process library: source-dirs: src -- 2.11.0