diff --git a/.github/scripts/extract-version.sh b/.github/scripts/extract-version.sh index 39cbeceb..51e5b031 100755 --- a/.github/scripts/extract-version.sh +++ b/.github/scripts/extract-version.sh @@ -24,6 +24,9 @@ fi # Check if pubspec exists if [ ! -f "$PUBSPEC_PATH" ]; then echo "❌ Error: pubspec.yaml not found at $PUBSPEC_PATH" >&2 + echo "📁 Current directory: $(pwd)" >&2 + echo "📂 Directory contents:" >&2 + ls -la apps/mobile/apps/ 2>&1 | head -20 >&2 exit 1 fi @@ -38,7 +41,8 @@ fi VERSION=$(echo "$VERSION_LINE" | sed 's/version: *//' | tr -d ' ') # Validate version format (X.Y.Z with optional +build or -suffix) -if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-+][a-zA-Z0-9]+)?$ ]]; then +# Use grep for better portability across different bash versions +if ! echo "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(\+[a-zA-Z0-9]+|-[a-zA-Z0-9]+)?$'; then echo "❌ Error: Invalid version format in pubspec.yaml: $VERSION" >&2 echo "Expected format: X.Y.Z, X.Y.Z+build, or X.Y.Z-suffix (e.g., 0.1.0, 0.1.0+12, 0.1.0-m3)" >&2 exit 1