Skip to content

Add framework versions in commit message #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/patch
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,22 @@ git commit -m "Stage framework" --no-verify > /dev/null

# Check for a specific requested version
if [ "$TARGET_VERSION" ]; then
composer require --no-scripts --with-all-dependencies "$PACKAGE" "$TARGET_VERSION"
OUTPUT=$(composer require --no-scripts --with-all-dependencies "$PACKAGE" "$TARGET_VERSION" 2>&1)
# Otherwise get the latest
else
composer update --no-scripts --with-all-dependencies "$PACKAGE"
OUTPUT=$(composer update --no-scripts --with-all-dependencies "$PACKAGE" 2>&1)
fi

for LINE in "$OUTPUT"; do
echo "$LINE\n"
if command -v sed > /dev/null 2>&1; then
TMP=$(echo $LINE | grep "$PACKAGE" | sed -n 's/.*(\(v[0-9]*\.[0-9]*\.[0-9]* => v[0-9]*\.[0-9]*\.[0-9]*\)).*/\1/p')
if [ -n "$TMP" ]; then
FROMTO="($TMP)"
fi
fi
done

# Wipe out the current versions and copy in the new
for ITEM in $ITEMS; do
rm -rf "$ITEM"
Expand All @@ -178,7 +188,7 @@ done
# Add everything but the modified Composer files
git add .
git reset composer.*
git commit -m "Patch framework" --no-verify
git commit -m "Patch framework $FROMTO" --no-verify

# Get rid of the now-corrupt Composer files
rm composer.*
Expand Down