File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ SCRIPT_FILE="n8n-manager.sh"
88
99# Function to get current version
1010get_current_version () {
11- grep -E ' ^SCRIPT_VERSION=' " $SCRIPT_FILE " | cut -d' "' -f2
11+ # Support either SCRIPT_VERSION="x.y.z" or VERSION="x.y.z"
12+ grep -E ' ^(SCRIPT_VERSION|VERSION)=' " $SCRIPT_FILE " | head -n1 | cut -d' "' -f2
1213}
1314
1415# Function to bump version (major, minor, patch)
@@ -43,8 +44,12 @@ echo "Current version: $CURRENT_VERSION"
4344echo " Bumping type: $BUMP_TYPE "
4445echo " New version: $NEW_VERSION "
4546
46- # Update version in script file
47- sed -i " s/^SCRIPT_VERSION=.*/SCRIPT_VERSION=\" $NEW_VERSION \" /" " $SCRIPT_FILE "
47+ # Update version in script file: replace VERSION= or SCRIPT_VERSION=
48+ if grep -q ' ^SCRIPT_VERSION=' " $SCRIPT_FILE " ; then
49+ sed -i " s/^SCRIPT_VERSION=.*/SCRIPT_VERSION=\" $NEW_VERSION \" /" " $SCRIPT_FILE "
50+ else
51+ sed -i " s/^VERSION=.*/VERSION=\" $NEW_VERSION \" /" " $SCRIPT_FILE "
52+ fi
4853
4954# Output new version for GitHub Actions
5055echo " new_version=$NEW_VERSION " >> " $GITHUB_OUTPUT "
You can’t perform that action at this time.
0 commit comments