Skip to content

Commit

Permalink
Apply runtime patch only apply if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Aug 8, 2024
1 parent b280772 commit 34743cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion patch_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ index 33ecc260dd..dea79f6095 100644
type ticksType struct {
EOF

CMD="-tN -r- `go env GOROOT`/src/runtime/runtime.go"
FILE="$(go env GOROOT)/src/runtime/runtime.go"
CMD="-tN -r- $FILE"
OS=`uname -s`

if [[ ! -z $(grep "GetGoID" "$FILE") ]]; then
echo "$FILE is already patched!"
exit 0
fi

if ! patch --dry-run -R $CMD <<< "$PATCH" >> /dev/null; then
if [[ $OS == "Darwin" ]]; then
patch $CMD <<< "$PATCH" && echo "Runtime Patched!"
Expand Down

0 comments on commit 34743cb

Please sign in to comment.