summaryrefslogtreecommitdiff
path: root/Omni/Task.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Task.hs')
-rw-r--r--Omni/Task.hs26
1 files changed, 0 insertions, 26 deletions
diff --git a/Omni/Task.hs b/Omni/Task.hs
index 7ad0548..74e1e8a 100644
--- a/Omni/Task.hs
+++ b/Omni/Task.hs
@@ -21,7 +21,6 @@ import qualified Omni.Test as Test
import qualified System.Console.Docopt as Docopt
import System.Directory (doesFileExist, removeFile)
import System.Environment (setEnv)
-import System.Process (readProcess)
import qualified Test.Tasty as Tasty
import Prelude (read)
@@ -56,7 +55,6 @@ Usage:
task stats [--epic=<id>] [--json]
task export [-o <file>]
task import -i <file>
- task sync
task test
task (-h | --help)
@@ -74,7 +72,6 @@ Commands:
stats Show task statistics
export Export tasks to JSONL
import Import tasks from JSONL file
- sync Export and commit task changes locally
test Run tests
Options:
@@ -377,7 +374,6 @@ move' args
Just f -> pure (T.pack f)
importTasks (T.unpack file)
putText <| "Imported tasks from " <> file
- | args `Cli.has` Cli.command "sync" = syncTasks
| otherwise = putText (T.pack <| Cli.usage help)
where
getArgText :: Cli.Arguments -> String -> IO Text
@@ -387,23 +383,6 @@ move' args
Nothing -> panic (T.pack name <> " required")
Just val -> pure (T.pack val)
-syncTasks :: IO ()
-syncTasks = do
- let jsonlPath = ".tasks/tasks.jsonl"
- exportTasks (Just jsonlPath)
- hasChanges <- checkGitChanges jsonlPath
- if hasChanges
- then do
- _ <- readProcess "git" ["add", jsonlPath] ""
- _ <- readProcess "git" ["commit", "-m", "task: sync task database"] ""
- putText "Task changes committed locally."
- else putText "No task changes to sync."
- where
- checkGitChanges :: FilePath -> IO Bool
- checkGitChanges path = do
- status <- readProcess "git" ["status", "--porcelain", path] ""
- pure (not (null status))
-
test :: Test.Tree
test =
Test.group
@@ -815,11 +794,6 @@ cliTests =
Right args -> do
args `Cli.has` Cli.command "stats" Test.@?= True
Cli.getArg args (Cli.longOption "epic") Test.@?= Just "t-abc123",
- Test.unit "sync command" <| do
- let result = Docopt.parseArgs help ["sync"]
- case result of
- Left err -> Test.assertFailure <| "Failed to parse 'sync': " <> show err
- Right args -> args `Cli.has` Cli.command "sync" Test.@?= True,
Test.unit "create with flags in different order" <| do
let result = Docopt.parseArgs help ["create", "Test", "--json", "--priority=1", "--namespace=Omni/Task"]
case result of