Skip to content

Commit bd240f1

Browse files
committed
pacman-helper.sh: fix usage of release notes file
The empty file was created as release_notes.txt in the CWD, while it was written to as release-notes.txt in $dir/$arch subdirectories, and ultimately read as release-notes.txt I believe in the CWD again. Get rid of the ambiguity by always referencing it as "$dir/release_notes.txt" Signed-off-by: Jeremy Drake <[email protected]>
1 parent b442b20 commit bd240f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pacman-helper.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ quick_action () { # <action> <file>...
349349
test -z "$GPGKEY" || sign_option=--sign
350350
dbs=
351351
to_push=
352-
>release_notes.txt
352+
>"$dir/release_notes.txt"
353353
for arch in $architectures
354354
do
355355
eval "msys=\$${arch}_msys"
@@ -456,14 +456,14 @@ quick_action () { # <action> <file>...
456456
"$(printf '%s\n' $msys $mingw |
457457
sed 's/^\(.*\)-\([^-]*-[^-]*\)-[^-]*\.pkg\.tar\.\(xz\|zst\)$/\1 -> \2/')")"
458458
printf '%s\n' $msys $mingw |
459-
sed 's/^\(.*\)-\([^-]*-[^-]*\)-[^-]*\.pkg\.tar\.\(xz\|zst\)$/* \1 -> \2/' >>release-notes.txt
459+
sed 's/^\(.*\)-\([^-]*-[^-]*\)-[^-]*\.pkg\.tar\.\(xz\|zst\)$/* \1 -> \2/' >>"$dir/release_notes.txt"
460460
;;
461461
remove)
462462
msg="$(printf 'Remove %s package(s)\n\n%s\n' \
463463
$(printf '%s\n' $msys $mingw | wc -l) \
464464
"$(printf '%s\n' $msys $mingw)")"
465465
printf '%s\n' $msys $mingw |
466-
sed 's/^/* dropped /' >>release-notes.txt
466+
sed 's/^/* dropped /' >>"$dir/release_notes.txt"
467467
;;
468468
esac &&
469469
git commit -asm "$msg") ||
@@ -551,7 +551,7 @@ quick_action () { # <action> <file>...
551551
then
552552
echo "Would create a GitHub Release '$tagname' at git-for-windows/pacman-repo" >&2
553553
else
554-
body="$(sed -z 's/[\"]/\\&/g;s/\n/\\n/g' release-notes.txt)"
554+
body="$(sed -z 's/[\"]/\\&/g;s/\n/\\n/g' "$dir/release_notes.txt")"
555555
id="$(curl -H "Authorization: Bearer $GITHUB_TOKEN" -sfL --show-error -XPOST -d \
556556
'{"tag_name":"'"$tagname"'","name":"'"$tagname"'","body":"'"$body"'","draft":true,"prerelease":true}' \
557557
"https://api.github.com/repos/git-for-windows/pacman-repo/releases" |

0 commit comments

Comments
 (0)