aboutsummaryrefslogtreecommitdiff
path: root/bin/xgo.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-28 00:13:06 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-28 00:13:06 +1300
commit8215cba30d96b421ff0b434b5900fa60af5e1a4b (patch)
treee0a800d9f03580d8daf7524f40cafd8fe9e28061 /bin/xgo.sh
parentMerge branch 'release/v4.0.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-4.1.0.tar.gz (sig)
dotfiles-4.1.0.zip
Merge branch 'release/v4.1.0'v4.1.0
* release/v4.1.0: Bump VERSION Correct typo in stub vimrc Remove some vestigial Bash 2.05 guards/comments Break up some long lines Two-space sentences in VimL comments Two-space sentences in shell comments Break up some long lines Fix long lines in manual pages Two-space sentences in manual pages Adjust sentence spacing of README.md Remove highlight double-quote VimL comment strings
Diffstat (limited to 'bin/xgo.sh')
-rw-r--r--bin/xgo.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/xgo.sh b/bin/xgo.sh
index e627f9c6..1b9f83da 100644
--- a/bin/xgo.sh
+++ b/bin/xgo.sh
@@ -12,7 +12,8 @@ for url do (
# Look for patterns in the URL that suggest transformations
case $url in
- # If this is a GitHub or GitLab link, swap "blob" for "raw" to get the actual file
+ # If this is a GitHub or GitLab link, swap "blob" for "raw" to get the
+ # actual file
(*://github.com/*/blob/*|*://gitlab.com/*/blob/*)
url=$(printf '%s\n' "$url" | sed 's_/blob/_/raw/_')
;;
@@ -20,7 +21,8 @@ for url do (
# Dig out the plain text for pastebin.com links
(*://pastebin.com/*)
# shellcheck disable=SC2016
- url=$(printf '%s\n' "$url" | sed 's_/[A-Za-z0-9][A-Za-z0-9]*$_/raw&_')
+ url=$(printf '%s\n' "$url" |
+ sed 's_/[A-Za-z0-9][A-Za-z0-9]*$_/raw&_')
;;
# If this is a not-direct imgur link and not to an album, swap URL
@@ -28,10 +30,12 @@ for url do (
# the MIME type will tell us)
(*://imgur.com/a/*) ;;
(*://imgur.com/*)
- url=$(printf '%s\n' "$url" | sed 's_imgur\.com_i.imgur.com_;s/$/.jpg/')
+ url=$(printf '%s\n' "$url" |
+ sed 's_imgur\.com_i.imgur.com_;s/$/.jpg/')
;;
- # If this is a YouTube video without a given start time, load it in mpv(1)
+ # If this is a YouTube video without a given start time, load it in
+ # mpv(1)
(*[/.]youtube.com/watch*[?\&]t=) ;;
(*[/.]youtube.com/watch*)
mpv -- "$url" && exit