Skip to content

Commit 619b06c

Browse files
authored
Merge pull request #35 from kenjis/feat-add-versions-commit-log
Add framework versions in commit message
2 parents 2c4d319 + fee56bf commit 619b06c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/patch

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,22 @@ git commit -m "Stage framework" --no-verify > /dev/null
163163

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

172+
for LINE in "$OUTPUT"; do
173+
echo "$LINE\n"
174+
if command -v sed > /dev/null 2>&1; then
175+
TMP=$(echo $LINE | grep "$PACKAGE" | sed -n 's/.*(\(v[0-9]*\.[0-9]*\.[0-9]* => v[0-9]*\.[0-9]*\.[0-9]*\)).*/\1/p')
176+
if [ -n "$TMP" ]; then
177+
FROMTO="($TMP)"
178+
fi
179+
fi
180+
done
181+
172182
# Wipe out the current versions and copy in the new
173183
for ITEM in $ITEMS; do
174184
rm -rf "$ITEM"
@@ -178,7 +188,7 @@ done
178188
# Add everything but the modified Composer files
179189
git add .
180190
git reset composer.*
181-
git commit -m "Patch framework" --no-verify
191+
git commit -m "Patch framework $FROMTO" --no-verify
182192

183193
# Get rid of the now-corrupt Composer files
184194
rm composer.*

0 commit comments

Comments
 (0)