From 4081920709d6e2ead8ce4070905d064ec214f4d1 Mon Sep 17 00:00:00 2001 From: Reshetnikov_AS Date: Fri, 1 Mar 2024 23:31:33 +0400 Subject: [PATCH] check xterm --- .github/workflows/ci-test-run.yml | 2 +- _AutoinstallCreator/test_update.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-test-run.yml b/.github/workflows/ci-test-run.yml index 58d300e5..bf65b500 100644 --- a/.github/workflows/ci-test-run.yml +++ b/.github/workflows/ci-test-run.yml @@ -31,7 +31,7 @@ jobs: if: matrix.artifact == 'ubuntu' run: | apt update - apt install -y busybox dos2unix libarchive-tools python3 git xterm + apt install -y busybox dos2unix libarchive-tools python3 git git config --global --add safe.directory '*' - name: Install Alpine packages diff --git a/_AutoinstallCreator/test_update.py b/_AutoinstallCreator/test_update.py index d1593bc0..fcea90ba 100644 --- a/_AutoinstallCreator/test_update.py +++ b/_AutoinstallCreator/test_update.py @@ -13,7 +13,7 @@ _root_path: str = os.path.dirname(_self_path) _tools_path: str = os.path.join(_root_path, '.tools') -busybox_exe_path_arg: list[str] = ['xterm', '-e'] +busybox_exe_path_arg: list[str] = [] update_script_name: str = 'update.sh' package_name = 'AutoinstallCreator.sh' if sys.platform.startswith('win'): @@ -41,10 +41,16 @@ class TestUpdate(unittest.TestCase): @classmethod def setUpClass(cls) -> None: + global busybox_exe_path_arg + pathlib.Path(os.path.join(_self_path, 'AutoinstallCreator.sh')).unlink(missing_ok=True) pathlib.Path(os.path.join(_self_path, 'AutoinstallCreator.sh.bat')).unlink(missing_ok=True) pathlib.Path(_self_body_path).unlink(missing_ok=True) + if not sys.platform.startswith('win'): + if shutil.which('xterm'): + busybox_exe_path_arg = ['xterm', '-e'] + subprocess.run(busybox_exe_path_arg + [os.path.join(_self_path, 'release.sh')], check=True) cls.version_str = io_tools.read_text(_self_body_path).strip('\r\n')