mirror of https://github.com/zulip/zulip.git
export: Let mkdtemp pick its favorite directory.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
79d888223f
commit
b37ed12df2
|
@ -33,7 +33,7 @@ class Command(BaseCommand):
|
|||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
output_dir = options["output_dir"]
|
||||
if output_dir is None:
|
||||
output_dir = tempfile.mkdtemp(prefix="/tmp/converted-gitter-data-")
|
||||
output_dir = tempfile.mkdtemp(prefix="converted-gitter-data-")
|
||||
else:
|
||||
output_dir = os.path.realpath(output_dir)
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class Command(BaseCommand):
|
|||
def handle(self, *args: Any, **options: Any) -> None:
|
||||
output_dir = options["output_dir"]
|
||||
if output_dir is None:
|
||||
output_dir = tempfile.mkdtemp(prefix="/tmp/converted-slack-data-")
|
||||
output_dir = tempfile.mkdtemp(prefix="converted-slack-data-")
|
||||
else:
|
||||
output_dir = os.path.realpath(output_dir)
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
output_dir = options["output_dir"]
|
||||
if output_dir is None:
|
||||
output_dir = tempfile.mkdtemp(prefix="/tmp/zulip-export-")
|
||||
output_dir = tempfile.mkdtemp(prefix="zulip-export-")
|
||||
else:
|
||||
output_dir = os.path.realpath(os.path.expanduser(output_dir))
|
||||
if os.path.exists(output_dir):
|
||||
|
|
|
@ -34,7 +34,7 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
output_dir = options["output_dir"]
|
||||
if output_dir is None:
|
||||
output_dir = tempfile.mkdtemp(prefix="/tmp/zulip-export-")
|
||||
output_dir = tempfile.mkdtemp(prefix="zulip-export-")
|
||||
if os.path.exists(output_dir):
|
||||
shutil.rmtree(output_dir)
|
||||
os.makedirs(output_dir)
|
||||
|
|
Loading…
Reference in New Issue