Unless the log starts with a command that records a seed.
addHistory :: SimState t -> SimCommand -> SimState t
addHistory st c = st { simHistory = c : simHistory st }
+recordSeed :: SimState t -> [SimCommand] -> SimState t
+recordSeed st (CommandSeed _:_) = st
+recordSeed st _ = addHistory st (CommandSeed (simRng st))
+
newtype RepoName = RepoName { fromRepoName :: String }
deriving (Show, Read, Eq, Ord)
startup simdir st cs = do
repobyname <- mkGetExistingRepoByName
createAnnexDirectory (toRawFilePath simdir)
- st' <- go st repobyname cs
- liftIO $ saveState st'
+ let st' = recordSeed st cs
+ st'' <- go st' repobyname cs
+ liftIO $ saveState st''
go st _ [] = return st
go st repobyname (c:cs) = do