From de0c4e1f3f0bc8ceb2cfb092468cdb8aa608948d Mon Sep 17 00:00:00 2001 From: Kamila Paulina Godlewska Date: Fri, 17 Oct 2025 13:17:32 +0200 Subject: [PATCH 1/4] Refactor BASE_DOCKER_COMMAND for Windows support relate to #571 --- easy_toolbox.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/easy_toolbox.py b/easy_toolbox.py index 897fb4db9..d491ef302 100755 --- a/easy_toolbox.py +++ b/easy_toolbox.py @@ -19,7 +19,13 @@ import sys from shlex import quote -BASE_DOCKER_COMMAND = "OIOIOI_UID=$(id -u) docker compose" + " -f docker-compose-dev.yml" +if sys.platform == "win32": + # for Windows, a different syntax command_prefix is needed + command_prefix = "set OIOIOI_UID=1000 &&" +else: + command_prefix = "OIOIOI_UID=$(id -u)" + +BASE_DOCKER_COMMAND = f"{command_prefix} docker compose" + " -f docker-compose-dev.yml" RAW_COMMANDS = [ ("build", "Build OIOIOI container from source.", "build", True), @@ -132,7 +138,7 @@ def get_action_from_gui() -> Option: ), ] answers = inquirer.prompt(questions) - return answers["action"] + return COMMANDS[answers["action"]] def run_command(command) -> None: @@ -140,7 +146,9 @@ def run_command(command) -> None: if not NO_INPUT: width = os.get_terminal_size().columns print("=" * width) - sys.exit(os.WEXITSTATUS(os.system(command))) + + exit_code = os.system(command) + sys.exit(exit_code) def warn_user(action: Option) -> bool: @@ -189,6 +197,5 @@ def main() -> None: except Exception as e: print(f"An error occurred during execution: {e}", file=sys.stderr) - if __name__ == "__main__": main() From 7f9d6476584f6857c14d406baddf3ed9c2b56e91 Mon Sep 17 00:00:00 2001 From: Kamila Paulina Godlewska Date: Fri, 17 Oct 2025 13:32:54 +0200 Subject: [PATCH 2/4] Refactor command exit handling for cross-platform support relate to sio2project#571 --- easy_toolbox.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/easy_toolbox.py b/easy_toolbox.py index d491ef302..8a4a0da89 100755 --- a/easy_toolbox.py +++ b/easy_toolbox.py @@ -147,8 +147,13 @@ def run_command(command) -> None: width = os.get_terminal_size().columns print("=" * width) - exit_code = os.system(command) - sys.exit(exit_code) + + if sys.platform == "win32": + # for Windows, a different syntax for exiting is needed + exit_code = os.system(command) + sys.exit(exit_code) + else: + sys.exit(os.WEXITSTATUS(os.system(command))) def warn_user(action: Option) -> bool: From b9f39f43766cebe460aadb1c7cd52ce03ef9debc Mon Sep 17 00:00:00 2001 From: Kamila Paulina Godlewska Date: Fri, 17 Oct 2025 13:42:53 +0200 Subject: [PATCH 3/4] Create .gitattributes for multi-system support Add .gitattributes for cross-platform line endings Closes sio2project#571 --- .gitattributes | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..f4d60b10b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# This file exists for multi-system support + +# default file behaviour +* text=auto + +# make all '.sh' files LF, regardless of users' OS +*.sh text eol=lf From 14698e18a4cec3ba00d71becd2fb8d55dc472247 Mon Sep 17 00:00:00 2001 From: Kamila Paulina Godlewska Date: Sun, 19 Oct 2025 11:43:54 +0200 Subject: [PATCH 4/4] Fix BASE_DOCKER_COMMAND formatting concatenation deleated --- easy_toolbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy_toolbox.py b/easy_toolbox.py index 8a4a0da89..8681e15e8 100755 --- a/easy_toolbox.py +++ b/easy_toolbox.py @@ -25,7 +25,7 @@ else: command_prefix = "OIOIOI_UID=$(id -u)" -BASE_DOCKER_COMMAND = f"{command_prefix} docker compose" + " -f docker-compose-dev.yml" +BASE_DOCKER_COMMAND = f"{command_prefix} docker compose -f docker-compose-dev.yml" RAW_COMMANDS = [ ("build", "Build OIOIOI container from source.", "build", True),