Skip to content

Commit

Permalink
make script compatible in Linux & macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dlqqq committed Apr 25, 2024
1 parent fccf4ef commit 599ece0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 599ece0

Please sign in to comment.