Skip to content

Commit 92f9f24

Browse files
committed
tweak to the tmp dir cleanup option
1 parent ab78592 commit 92f9f24

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export TMPDIR := $(HOME)/snap/firefox/common/tmp
1616
$(TMPDIR):
1717
mkdir -p $(TMPDIR)
1818

19+
export TMPDIR_CLEANUP = false
20+
1921
part%.forbook.asciidoc: part%.asciidoc
2022
cat $(subst .forbook.,.,$@) \
2123
| sed 's/^== /= /' \

tests/sourcetree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ApplyCommitException(Exception):
7373
pass
7474

7575

76-
class SourceTree(object):
76+
class SourceTree:
7777
def __init__(self):
7878
self.tempdir = Path(tempfile.mkdtemp())
7979
self.processes = []
@@ -89,7 +89,7 @@ def cleanup(self):
8989
os.killpg(process.pid, signal.SIGTERM)
9090
except OSError:
9191
pass
92-
if getpass.getuser() != "harry":
92+
if os.environ.get("TMPDIR_CLEANUP") not in ("0", "false"):
9393
shutil.rmtree(self.tempdir)
9494

9595
def run_command(

0 commit comments

Comments
 (0)