Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve version bump script #73

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/version-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ if [ -z "$new_version" ]; then
fi

new_version="$major.$minor.$patch"

echo "Updating version from $old_version to $new_version..."
fi

files_to_update=(
Expand All @@ -71,17 +73,17 @@ for file_path in "${files_to_update[@]}"; do
;;
"powerpod/package.json")
# Update version number in package.json
sed -i '' -E "s/\"version\": \"$old_version\"/\"version\": \"$new_version\"/g" "$file_path"
sed -i '' -E "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+\"/\"version\": \"$new_version\"/g" "$file_path"
echo "Updated $file_path with new version $new_version"
;;
"powerpod/rollup.config.js")
# Update version number in rollup.config.js
sed -i '' -E "s/\* powerpod $old_version/\* powerpod $new_version/g" "$file_path"
sed -i '' -E "s/\* powerpod [0-9]+\.[0-9]+\.[0-9]+/\* powerpod $new_version/g" "$file_path"
echo "Updated $file_path with new version $new_version"
;;
"powerpod/src/js/powerpod.js")
# Update version number in powerpod.js
sed -i '' -E "s/POWERPOD.version = '$old_version'/POWERPOD.version = '$new_version'/g" "$file_path"
sed -i '' -E "s/POWERPOD\.version = '[0-9]+\.[0-9]+\.[0-9]+'/POWERPOD.version = '$new_version'/g" "$file_path"
echo "Updated $file_path with new version $new_version"
;;
*)
Expand Down