From 68e0eb23fa95eaee27e2880d1670cfbfd0e6689c Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Sat, 13 Jul 2024 00:56:18 +0200 Subject: [PATCH] Provide a backup suffix for sed -i (in-place) option when on MacOS Backup suffix following the -i option is required on macOS. --- build_docs.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build_docs.py b/build_docs.py index b5a1916..1f9da70 100755 --- a/build_docs.py +++ b/build_docs.py @@ -30,6 +30,7 @@ import logging.handlers from functools import total_ordering from os import readlink +import platform import re import shlex import shutil @@ -745,13 +746,14 @@ def build(self): sphinxbuild = self.venv / "bin" / "sphinx-build" blurb = self.venv / "bin" / "blurb" # Disable cpython switchers, we handle them now: + + def is_mac(): + return platform.system() == 'Darwin' + run( - [ - "sed", - "-i", - "s/ *-A switchers=1//", - self.checkout / "Doc" / "Makefile", - ] + ["sed", "-i"] + + ([""] if is_mac() else []) + + ["s/ *-A switchers=1//", self.checkout / "Doc" / "Makefile"] ) self.version.setup_indexsidebar( self.versions,