Skip to content

Commit

Permalink
Update release script for linux environments (#3086)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Chin <akchin@us.ibm.com>
Co-authored-by: Kevin Bates <kbates4@gmail.com>
  • Loading branch information
akchinSTC and kevin-bates authored Jan 24, 2023
1 parent 13fd1cf commit 720c38c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion create-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 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)
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

Expand Down

0 comments on commit 720c38c

Please # to comment.