Skip to content

Commit

Permalink
Merge pull request #7474 from Automattic/fix/update-version-script
Browse files Browse the repository at this point in the history
Fix update version script to support alpha versions
  • Loading branch information
renatho authored Feb 7, 2024
2 parents 07aa4f5 + bd92a71 commit 0f2de57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ if [[ "$OS_TYPE" == "Darwin" ]]; then
# You are on macOS

# Update version in sensei-lms.php
sed -E -i '' "s/\* Version: [0-9]+\.[0-9]+\.[0-9]+/\* Version: $VERSION/" "$CURRENT_DIR/sensei-lms.php"
sed -E -i '' "s/\* Version: .*/\* Version: $VERSION/" "$CURRENT_DIR/sensei-lms.php"

# Find constant and replace the version in sensei-lms.php:
# define( 'SENSEI_LMS_VERSION', '4.15.0' ); // WRCS: DEFINED_VERSION.
sed -E -i '' "s/'SENSEI_LMS_VERSION', '[0-9]+\.[0-9]+\.[0-9]+/'SENSEI_LMS_VERSION', '$VERSION/" "$CURRENT_DIR/sensei-lms.php"
sed -E -i '' "s/'SENSEI_LMS_VERSION', '[^']*'/'SENSEI_LMS_VERSION', '$VERSION'/" "$CURRENT_DIR/sensei-lms.php"

# Update version in the Stable Tag comment in readme.txt
# Stable tag: 4.15.0
Expand All @@ -39,11 +39,11 @@ elif [[ "$OS_TYPE" == "Linux" ]]; then
# You are on Linux

# Update version in sensei-lms.php
sed -E -i'' "s/\* Version: [0-9]+\.[0-9]+\.[0-9]+/\* Version: $VERSION/" "$CURRENT_DIR/sensei-lms.php"
sed -E -i'' "s/\* Version: .*/\* Version: $VERSION/" "$CURRENT_DIR/sensei-lms.php"

# Find constant and replace the version in sensei-lms.php:
# define( 'SENSEI_LMS_VERSION', '4.15.0' ); // WRCS: DEFINED_VERSION.
sed -E -i'' "s/'SENSEI_LMS_VERSION', '[0-9]+\.[0-9]+\.[0-9]+/'SENSEI_LMS_VERSION', '$VERSION/" "$CURRENT_DIR/sensei-lms.php"
sed -E -i'' "s/'SENSEI_LMS_VERSION', '[^']*'/'SENSEI_LMS_VERSION', '$VERSION'/" "$CURRENT_DIR/sensei-lms.php"

# Update version in the Stable Tag comment in readme.txt
# Stable tag: 4.15.0
Expand Down

0 comments on commit 0f2de57

Please sign in to comment.