commit a4c0a706e3bd5852147c61d76f051a2eb6224ab6 parent ad1e216e62a0c88f79d4ad4fa5dc72574fb579c2 Author: Alex Balgavy <a.balgavy@gmail.com> Date: Tue, 29 Sep 2020 15:39:07 +0200 curlhub: curl a raw file from Github Former-commit-id: 638a2f90e58ba81bafdc357587cdf913b48679c8 Diffstat:
A | scripts/curlhub | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/scripts/curlhub b/scripts/curlhub @@ -0,0 +1,6 @@ +#!/bin/sh +command -v curl 1>/dev/null 2>&1 || { printf "curl not installed\n" && exit 1; } +[ $# -lt 2 ] && { printf "Usage:\twgethub username/repository filename [branch]\n" && exit 1; } +lnk="https://raw.githubusercontent.com/$1/${3:-master}/$2" +printf "%s\n" "Saving to current directory from $lnk" +curl -LO "$lnk"