From 1ef606c1ddd2f9070f5f9899a439fef5cb7f5aae Mon Sep 17 00:00:00 2001 From: Alan Chin Date: Mon, 23 Jan 2023 13:17:11 -0800 Subject: [PATCH 1/2] Update release script for linux environments Signed-off-by: Alan Chin --- create-release.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/create-release.py b/create-release.py index 2609cb062..ecb18ffae 100755 --- a/create-release.py +++ b/create-release.py @@ -77,7 +77,12 @@ def dependency_exists(command) -> bool: def sed(file: str, pattern: str, replace: str) -> None: """Perform regex substitution on a given file""" try: - check_run(["sed", "-i", "", "-e", f"s#{pattern}#{replace}#g", file], capture_output=False) + if sys.platform == "linux" or "linux2": + check_run(["sed", "-i", "-e", f"s#{pattern}#{replace}#g", file], capture_output=False) + elif sys.platform == "darwin": + check_run(["sed", "-i", "", "-e", f"s#{pattern}#{replace}#g", file], capture_output=False) + else: # windows, other + raise RuntimeError(f"Current operating system not supported for release publishing: {sys.platform}: ") except Exception as ex: raise RuntimeError(f"Error processing updated to file {file}: ") from ex From d03134dee2f6cbb6879a81a00ef020b1fc777dbb Mon Sep 17 00:00:00 2001 From: Alan Chin Date: Mon, 23 Jan 2023 15:05:59 -0800 Subject: [PATCH 2/2] Update create-release.py Co-authored-by: Kevin Bates --- create-release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-release.py b/create-release.py index ecb18ffae..d0bd13ed8 100755 --- a/create-release.py +++ b/create-release.py @@ -77,7 +77,7 @@ def dependency_exists(command) -> bool: def sed(file: str, pattern: str, replace: str) -> None: """Perform regex substitution on a given file""" try: - if sys.platform == "linux" or "linux2": + if sys.platform in ["linux", "linux2"]: check_run(["sed", "-i", "-e", f"s#{pattern}#{replace}#g", file], capture_output=False) elif sys.platform == "darwin": check_run(["sed", "-i", "", "-e", f"s#{pattern}#{replace}#g", file], capture_output=False)