Add an option to push
authorCameron Ball <cameron@moodle.com>
Fri, 14 Jun 2019 06:24:21 +0000 (14:24 +0800)
committerCameron Ball <cameron@moodle.com>
Fri, 14 Jun 2019 06:24:21 +0000 (14:24 +0800)
app/Main.hs

index 0b0c25b..267ca5f 100644 (file)
@@ -82,6 +82,13 @@ entry = do
     else return ()
   build
 
+  putStrLn "Do you want to push this entry?"
+  push <- getLine
+
+  if (push == "y")
+    then (callCommand $ "git add . && git commit -m \"" ++ entryName ++ "\" && git push") >> putStrLn "Thank for using xyz"
+    else return ()
+
 usage :: IO ()
 usage =  putStr . ununlines $ [
   "usage: xyz <command>",