Skip to content

Commit

Permalink
dev: make a script for bump version of crates
Browse files Browse the repository at this point in the history
  • Loading branch information
hulxv committed Sep 6, 2024
1 parent d6357a1 commit 497747d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/html-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "html-generator"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
description = "A simple library to generate html content with a simple way."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/metassr-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-build"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
description = "Web builder & client bundler (built on Rspack), built for MetaSSR."
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/metassr-create/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-create"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
build = "build.rs"

Expand Down
2 changes: 1 addition & 1 deletion crates/metassr-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-utils"
version = "0.1.0"
version = "0.0.1-alpha"
edition = "2021"
description = "Important utilites for MetaSSR"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion metassr-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "metassr-cli"
version = "0.1.0-alpha"
version = "0.0.1-alpha"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
22 changes: 22 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "Usage: $0 <new-version>"
exit 1
fi

NEW_VERSION=$1

update_version() {
local file=$1
echo "Updating version in $file to $NEW_VERSION"
# Use `sed` to find and replace the version in the Cargo.toml file
sed -i -E "s/^version = \"[^\"]+\"/version = \"$NEW_VERSION\"/" "$file"
}

# Find all Cargo.toml files and update their versions
find . -name 'Cargo.toml' -print0 | while IFS= read -r -d '' file; do
update_version "$file"
done

echo "Version update completed."

0 comments on commit 497747d

Please sign in to comment.