set simRootDirectory on restore
It's a relative directory and the cwd may be different. Or the repo could have been moved.
This commit is contained in:
parent
bab330de33
commit
31679e3e9f
1 changed files with 5 additions and 4 deletions
|
@ -1089,13 +1089,14 @@ restoreSim rootdir =
|
||||||
Right c -> case readMaybe c :: Maybe (SimState ()) of
|
Right c -> case readMaybe c :: Maybe (SimState ()) of
|
||||||
Nothing -> return (Left "unable to parse sim state file")
|
Nothing -> return (Left "unable to parse sim state file")
|
||||||
Just st -> do
|
Just st -> do
|
||||||
|
let st' = st { simRootDirectory = fromRawFilePath rootdir }
|
||||||
repostate <- M.fromList
|
repostate <- M.fromList
|
||||||
<$> mapM (thaw st) (M.toList (simRepoState st))
|
<$> mapM (thaw st') (M.toList (simRepoState st))
|
||||||
let st' = st
|
let st'' = st'
|
||||||
{ simRepoState =
|
{ simRepoState =
|
||||||
M.map (finishthaw st') repostate
|
M.map (finishthaw st'') repostate
|
||||||
}
|
}
|
||||||
return (Right st')
|
return (Right st'')
|
||||||
where
|
where
|
||||||
thaw st (u, rst) = tryNonAsync (thaw' st u) >>= return . \case
|
thaw st (u, rst) = tryNonAsync (thaw' st u) >>= return . \case
|
||||||
Left _ -> (u, rst { simRepo = Nothing })
|
Left _ -> (u, rst { simRepo = Nothing })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue