Launch editor after entry command
authorCameron Ball <cameron@moodle.com>
Wed, 12 Jun 2019 05:32:35 +0000 (13:32 +0800)
committerCameron Ball <cameron@moodle.com>
Wed, 12 Jun 2019 05:32:35 +0000 (13:32 +0800)
app/Main.hs
package.yaml

index 0146ae9..d68cc4c 100644 (file)
@@ -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 $ [
index 966395a..71ad540 100644 (file)
@@ -27,6 +27,7 @@ dependencies:
 - template
 - json
 - filesystem-trees
+- process
 
 library:
   source-dirs: src