Update create-from-patch.sh

This commit is contained in:
uazo 2022-01-14 14:39:12 +01:00 committed by GitHub
parent 53605d6156
commit 9fc297d1b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,11 +22,11 @@ HEAD=$(sed -n '1,/---/ p' $PATCH | sed '/^---/d')
CONTENT=$(git -C ~/chromium/src/ diff --cached --binary) CONTENT=$(git -C ~/chromium/src/ diff --cached --binary)
PATCH_FILE=$PATCH_NEW_PATH/$(basename $PATCH) PATCH_FILE=$PATCH_NEW_PATH/$(basename $PATCH)
rm $PATCH_FILE test -f $PATCH_FILE && rm $PATCH_FILE
echo "$HEAD" >$PATCH_FILE echo "$HEAD" >$PATCH_FILE
NEWLINE=$(tail -n 1 "$PATCH_FILE") NEWLINE=$(tail -n 1 "$PATCH_FILE")
echo $NEWLINE #echo $NEWLINE
if [[ "$NEWLINE" == Subject:* ]]; then if [[ "$NEWLINE" == Subject:* ]]; then
echo "" >>$PATCH_FILE echo "" >>$PATCH_FILE
else else
@ -51,6 +51,9 @@ OK=1
git am $PATCH_FILE || OK=0 git am $PATCH_FILE || OK=0
if [[ OK -eq 0 ]]; then if [[ OK -eq 0 ]]; then
if [ -n "$SILENT" ]; then
exit 1
fi
echo "---> Failed to apply. Press return" echo "---> Failed to apply. Press return"
read -n 1 read -n 1
fi fi