Merge branch 'main' into 'main'

[FIX] #39: mkdir cross-platform on macOS

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!115
This commit is contained in:
Ken Woychesko 2025-05-12 20:21:49 +00:00
commit 54d53a4f27
4 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ and provides helpers to run (and replay) migrations until it works.
**Prerequites:** **Prerequites:**
* The tools run on debian system * The tools run on both Debian and MacOS systems
* You should have docker installed on your system * You should have docker installed on your system
* Some features require extra packages. To have all the features available run: * Some features require extra packages. To have all the features available run:

2
newsfragments/39 Normal file
View File

@ -0,0 +1,2 @@
Fix BSD mkdir incompatibility on macOS by using single-character
flags for 'mode' and 'parents' for cross-platform folder creation (#39)

View File

@ -35,8 +35,8 @@ def ensure_folder_exists(
- a log is done at INFO level. - a log is done at INFO level.
""" """
if not folder_path.exists(): if not folder_path.exists():
cmd = ["--parents", folder_path] cmd = ["-p", folder_path]
cmd = ["--mode", mode] + cmd cmd = ["-m", mode] + cmd
logger.info(f"Creating folder '{folder_path}' ...") logger.info(f"Creating folder '{folder_path}' ...")
mkdir(cmd) mkdir(cmd)

View File

@ -25,7 +25,7 @@ def move_to_test_folder():
if os.getcwd().endswith("tests/data/output"): if os.getcwd().endswith("tests/data/output"):
return return
test_folder_path = Path("tests/data/output") test_folder_path = Path("tests/data/output")
mkdir([test_folder_path, "--parents"]) mkdir(["-p", test_folder_path])
os.chdir(test_folder_path) os.chdir(test_folder_path)