-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbump.sh
More file actions
executable file
·40 lines (33 loc) · 912 Bytes
/
Copy pathbump.sh
File metadata and controls
executable file
·40 lines (33 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Version bump script for tvcode
CARGO_TOML="Cargo.toml"
# Get current version
CURRENT=$(grep '^version = ' "$CARGO_TOML" | sed 's/version = "\(.*\)"/\1/')
echo "Current version: $CURRENT"
# Parse version components
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
# Determine bump type
case "${1:-patch}" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
patch|*)
PATCH=$((PATCH + 1))
;;
esac
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "New version: $NEW_VERSION"
# Update Cargo.toml
sed -i '' "s/^version = \".*\"/version = \"$NEW_VERSION\"/" "$CARGO_TOML"
echo "✅ Updated $CARGO_TOML"
echo ""
echo "Next steps:"
echo " cargo build --release"
echo " sudo cp target/release/tvcode /usr/local/bin/"
echo " git add -A && git commit -m \"Bump version to $NEW_VERSION\""