From 599ece0f3ebab92cee59ebf04cdaf21fdaa1db69 Mon Sep 17 00:00:00 2001 From: "David L. Qiu" Date: Thu, 25 Apr 2024 09:56:46 -0700 Subject: [PATCH] make script compatible in Linux & macOS --- scripts/bump-version.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index dc3f7413f..6ac435fb1 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -17,6 +17,8 @@ if [[ "$PWD" == *packages/jupyter-ai ]]; then # bump dependency in jupyter-ai to rely on current version of jupyter-ai-magics # -E : use extended regex to allow usage of `+` symbol - # -i '' : modify file in-place - sed -E -i '' "s/jupyter_ai_magics.=[0-9]+\.[0-9]+\.[0-9]+/jupyter_ai_magics==$1/" pyproject.toml + # -i.bak : edit file in-place, generating a backup file ending in `.bak`, which we delete on success + # while confusing, this unfortunately is the only way to edit in-place on both macOS and Linux + # reference: https://stackoverflow.com/a/44864004 + sed -E -i.bak "s/jupyter_ai_magics.=[0-9]+\.[0-9]+\.[0-9]+/jupyter_ai_magics==$1/" pyproject.toml && rm pyproject.toml.bak fi