[FIX] #39: mkdir cross-platform on macOS
Replaced all plumbum.cmd.mkdir invocations that used GNU-style long-option forms for --mode and --parents with single-character flags (-m and -p). MacOS mkdir doesn’t support --mode or --parents in GNU-style long-option form. These work on GNU/Linux (Debian, Ubuntu, etc.), but macOS uses BSD-style utilities, where options are single-character flags like -p and -m (which also work on GNU/Linux).
This commit is contained in:
parent
6bb379d92b
commit
0aefd33d58
|
|
@ -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
2
newsfragments/39
Normal 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)
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user