ices-tools-prod / icesTAF

Functions to support the ICES Transparent Assessment Framework
GNU General Public License v3.0
5 stars 7 forks source link

catch errors in taf.bootstrap source={script} #8

Closed colinpmillar closed 5 years ago

colinpmillar commented 5 years ago

if a script errors when calling taf.bootstrap() with a DATA.bib entry that uses a script. Then the state of the working directory is left in `/bootstrap/data/'.

perhaps replace: https://github.com/ices-tools-prod/icesTAF/blob/a4841b398159d6ae59350770e84acfd8fd984325/R/process.inner.R#L47-L50

with

    owd <- setwd(dir)
    on.exit({
      setwd(owd)
    })
    source(script)
    setwd(owd)
colinpmillar commented 5 years ago

Current quick fix:

library(<package>, lib.loc = "../../library")
arni-magnusson commented 5 years ago

Well spotted, fixed in 60d556b.