Correctly get temp dir on Windows.

This commit is contained in:
Matthieu Gautier 2023-11-29 14:57:16 +01:00
parent 0e0ac010bb
commit 1f4409d2ac
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import zipfile
import subprocess
import re
import shutil
import platform
import requests
@ -41,7 +42,8 @@ SOURCE_DIR = HOME / "SOURCE"
ARCHIVE_DIR = HOME / "ARCHIVE"
TOOLCHAIN_DIR = BASE_DIR / "TOOLCHAINS"
INSTALL_DIR = BASE_DIR / "INSTALL"
TMP_DIR = Path(os.getenv("TMP_DIR", "/tmp"))
default_tmp_dir = os.getenv("TEMP") if platform.system() == 'Windows' else "/tmp"
TMP_DIR = Path(os.getenv("TMP_DIR", default_tmp_dir))
KBUILD_SOURCE_DIR = HOME / "kiwix-build"
_ref = _environ.get("GITHUB_REF", "").split("/")[-1]