sync-upstream: fix quoting

Otherwise strings in $TITLE and $BODAY that are enclosed in ` are executed in
gh-pr-create.sh.
This commit is contained in:
Jonas Nick 2021-09-15 20:09:35 +00:00
parent 9447642140
commit 95ee1fa030

View File

@ -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 <<EOT > "$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"