diff --git a/contrib/sync-upstream.sh b/contrib/sync-upstream.sh index 55dde4e1..b72744f4 100755 --- a/contrib/sync-upstream.sh +++ b/contrib/sync-upstream.sh @@ -100,11 +100,20 @@ git checkout master git pull git checkout -b temp-merge-"$PRNUM" +# Escape single quote +# ' -> '\'' +quote() { + local quoted=${1//\'/\'\\\'\'} + printf "%s" "$quoted" +} +TITLE=$(quote "$TITLE") +BODY=$(quote "$BODY") + BASEDIR=$(dirname "$0") FNAME="$BASEDIR/gh-pr-create.sh" cat < "$FNAME" #!/bin/sh -gh pr create -t "$TITLE" -b "$BODY" --web +gh pr create -t '$TITLE' -b '$BODY' --web # Remove temporary branch git checkout master git branch -D temp-merge-"$PRNUM"