Skip to content

Commit

Permalink
misc: Enhance wget-pr script
Browse files Browse the repository at this point in the history
I improved the recently-added wget-pr.sh script.
It's really useful to get the patch file by pull request number.
However, some systems (e.g. CentOS 7 or 8, fedora 33 or 34)
do not provide wget unless install manually.

This commit improves the script to get the patch with curl
if wget is not available.

Signed-off-by: Kang Minchul <[email protected]>
  • Loading branch information
kangtegong authored and namhyung committed Nov 6, 2023
1 parent 341bd7f commit 3acdd03
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion misc/wget-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@ if [ $# -ne "1" ]; then
fi

pr=$1
wget https://github.com/namhyung/uftrace/pull/$pr.patch

if [ -x "$(command -v wget)" ]; then
wget https://github.com/namhyung/uftrace/pull/$pr.patch
exit 0
elif [ -x "$(command -v curl)" ]; then
curl -L https://github.com/namhyung/uftrace/pull/$pr.patch > $pr.patch
exit 0
else
echo "You need wget or curl to run this script."
exit 1
fi

0 comments on commit 3acdd03

Please sign in to comment.