From e104b8473348fe3802a4b6eaf491517bf6f1b173 Mon Sep 17 00:00:00 2001 From: samedami Date: Thu, 14 May 2020 21:59:54 +0200 Subject: [PATCH] Changes in 'gethub' script Automatic made file executable when it have shebang. --- .local/bin/scripts/gethub | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.local/bin/scripts/gethub b/.local/bin/scripts/gethub index 7d5a405..b47ce32 100755 --- a/.local/bin/scripts/gethub +++ b/.local/bin/scripts/gethub @@ -7,3 +7,7 @@ echo "$1" | sed ' s/github.com/raw.githubusercontent.com/g; s/blob//g ' | xargs -r wget + +filename="$(echo "$1" | sed 's/.*\///g')" + +[ "$(sed 's/#\!\/.*/bang/g; 1q' "$filename")" = "bang" ] && chmod +x "$filename"