From e6ed72e590bcafa1586159fc236cc3c546f83523 Mon Sep 17 00:00:00 2001 From: techguy16 <88870951+techguy16@users.noreply.github.com> Date: Wed, 26 Jul 2023 11:19:37 +1200 Subject: [PATCH] Add Chmod +x --- umsktpy/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/umsktpy/__init__.py b/umsktpy/__init__.py index 6ebb859..2ae87b3 100644 --- a/umsktpy/__init__.py +++ b/umsktpy/__init__.py @@ -23,6 +23,15 @@ def find_umskt_executable(): raise OSError("Unsupported operating system. The 'umskt' executable is not available for this platform.") umskt_path = os.path.join(current_dir, umskt_name) + if os_name == "Linux": + command = ["chmod", "+x", umskt_path] + result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) + if os_name == "FreeBSD": + command = ["chmod", "+x", umskt_path] + result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) + if os_name == "Darwin": + command = ["chmod", "+x", umskt_path] + result = run(command, stdout=PIPE, stderr=PIPE, universal_newlines=True) if not os.path.exists(umskt_path): raise FileNotFoundError(f"The '{umskt_name}' executable was not found in the library directory for your operating system.")