File: set-version

package info (click to toggle)
awesomeversion 25.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,304 kB
  • sloc: python: 2,411; sh: 146; makefile: 5
file content (33 lines) | stat: -rwxr-xr-x 714 bytes parent folder | download
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
#!/bin/sh

# script/set-version: Update the version in pyproject.toml

set -e

cd "$(dirname "$0")/.."

if [ -z "$1" ]; then
    echo "Error: Version argument is required"
    echo "Usage: script/set-version <version>"
    echo "Example: script/set-version 1.2.3"
    exit 1
fi

VERSION="$1"

echo "==> Updating version to $VERSION..."

if [ -f "pyproject.toml" ]; then
    sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
    echo "==> Updated pyproject.toml"
else
    echo "Error: pyproject.toml not found"
    exit 1
fi

if grep -q "version = \"$VERSION\"" pyproject.toml; then
    echo "==> Version successfully updated to $VERSION"
else
    echo "Error: Failed to update version"
    exit 1
fi