FrontendOld/update-version.sh
2024-07-04 11:46:38 +02:00

14 lines
369 B
Bash
Executable file

#!/bin/bash
# Check if an argument is provided and not empty
if [ -z "$1" ]; then
echo "No new version provided. Won't update package.json."
exit 0 # Exit with success
fi
new_version=$1
# Update the version field in package.json
sed -i "s/\"version\": \".*\"/\"version\": \"$new_version\"/" package.json
echo "Version in package.json updated to: $new_version"