From 1f4409d2ac3e0c90f8a519819e0015f692305abe Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 29 Nov 2023 14:57:16 +0100 Subject: [PATCH] Correctly get temp dir on Windows. --- .github/scripts/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/common.py b/.github/scripts/common.py index 8eff9256..f1433ccf 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -7,6 +7,7 @@ import subprocess import re import shutil +import platform import requests @@ -41,7 +42,8 @@ def get_build_dir(config) -> Path: 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]