diff options
| -rw-r--r-- | Omni/Task/Core.hs | 3 | ||||
| -rw-r--r-- | debug_ns.hs | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 31c0981..54ed04d 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -111,7 +111,8 @@ generateId = do encoded = toBase62 (fromIntegral microseconds) pure <| "t-" <> T.pack encoded --- Generate a child ID based on parent ID (e.g. "t-abc.1") +-- Generate a child ID based on parent ID (e.g. "t-abc.1", "t-abc.1.2") +-- Finds the next available sequential suffix among existing children. generateChildId :: Text -> IO Text generateChildId parentId = do tasks <- loadTasks diff --git a/debug_ns.hs b/debug_ns.hs new file mode 100644 index 0000000..fbd4ea3 --- /dev/null +++ b/debug_ns.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NoImplicitPrelude #-} + +module Main where + +import Omni.Namespace +import Protolude +import qualified Data.Text as T + +main :: IO () +main = do + let root = "/home/ben/omni-worker-1" + let path = "/home/ben/omni-worker-1/Omni/Task.hs" + putStrLn $ "Root: " ++ root + putStrLn $ "Path: " ++ path + let res = fromPath root path + print res |
