mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
chore: add checks for RELEASE and VERSION variables
This commit is contained in:
parent
6c7144b47c
commit
bab239106a
21
.github/scripts/deploy-userguide
vendored
21
.github/scripts/deploy-userguide
vendored
@ -6,7 +6,26 @@
|
||||
SOURCE=$1
|
||||
TARGET=$2
|
||||
RELEASE=$3
|
||||
VERSION=`echo "$RELEASE" | cut -c 2-`
|
||||
|
||||
# Check if RELEASE is empty
|
||||
if [ -z "$RELEASE" ]; then
|
||||
echo "Error: \$RELEASE parameter is empty."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VERSION=$(echo "$RELEASE" | cut -c 2-)
|
||||
|
||||
# Check if VERSION is empty
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Error: Failed to extract \$VERSION from \$RELEASE parameter '$RELEASE'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if VERSION matches the format X.Y.Z
|
||||
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "Error: VERSION '$VERSION' does not match the expected format X.Y.Z."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Preparing for version $3"
|
||||
echo "Merging files from $1 to $2"
|
||||
|
Loading…
x
Reference in New Issue
Block a user