Skip to content

Commit

Permalink
Fix generate-patch script
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed Apr 24, 2023
1 parent 786e4a7 commit 9eba395
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions script/generate-patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ if [ $# -ne 1 ]; then
fi

FILE=Sources/$1/Generated.swift
NEW_HEADER=$(cat <<EOF
--- a/$FILE
+++ b/$FILE
EOF)

cp $FILE $FILE.modified
swift run WebIDLToSwift --no-patch
git diff --no-ext-diff --no-index $FILE $FILE.modified | tail -n +5 | sed "s/^/$NEW_HEADER/" | sed 's/[[:space:]]*$//'

cat <<EOF > "Patches/$1.patch"
--- a/$FILE
+++ b/$FILE
EOF

git diff --no-ext-diff --no-index $FILE $FILE.modified | tail -n +5 | sed 's/[[:space:]]*$//' >> "Patches/$1.patch"

swift run WebIDLToSwift
rm $FILE.modified

0 comments on commit 9eba395

Please sign in to comment.