Skip to content

Commit 69c4ed5

Browse files
committed
restore TEMPDIR_ROOT env var
1 parent f7a5cd6 commit 69c4ed5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ impl BitcoinD {
218218

219219
/// Launch the bitcoind process from the given `exe` executable with given [Conf] param
220220
pub fn with_conf<S: AsRef<OsStr>>(exe: S, conf: &Conf) -> Result<BitcoinD, Error> {
221-
let work_dir = match (&conf.tmpdir, &conf.staticdir) {
221+
let tmpdir = conf
222+
.tmpdir
223+
.clone()
224+
.or_else(|| env::var("TEMPDIR_ROOT").map(PathBuf::from).ok());
225+
let work_dir = match (&tmpdir, &conf.staticdir) {
222226
(Some(_), Some(_)) => return Err(Error::BothDirsSpecified),
223227
(Some(tmpdir), None) => DataDir::Temporary(TempDir::new_in(tmpdir)?),
224228
(None, Some(workdir)) => {

0 commit comments

Comments
 (0)