-
-
Notifications
You must be signed in to change notification settings - Fork 455
Expand file tree
/
Copy pathchangeVersion.sh
More file actions
executable file
·28 lines (22 loc) · 894 Bytes
/
Copy pathchangeVersion.sh
File metadata and controls
executable file
·28 lines (22 loc) · 894 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
#!/bin/bash
# Check if version parameter is provided
if [ -z "$1" ]; then
echo "Please provide a version number as parameter"
echo "Usage: ./changeVersion.sh v3.12.1"
exit 1
fi
# Add v prefix if not provided
NEW_VERSION=$1
if [[ ! $NEW_VERSION =~ ^v ]]; then
NEW_VERSION="v$NEW_VERSION"
fi
# Update version in root package.json
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" package.json
echo "Updated version in root package.json to $NEW_VERSION"
# Update version in client/package.json
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" client/package.json
echo "Updated version in client/package.json to $NEW_VERSION"
# Update version in server/package.json
sed -i '' "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" server/package.json
echo "Updated version in server/package.json to $NEW_VERSION"
echo "Version update complete!"