aboutsummaryrefslogtreecommitdiffstats
path: root/abbrevURL
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2024-03-28 19:26:56 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-03-28 19:26:56 +0100
commit1fb30f837693b487413c7263dbb6bad0505ca801 (patch)
tree416f8226ebc31d66ca66eb4eac8793b96c5321ca /abbrevURL
parentbf71b4668e7e4426a3127d2a7dc8acbf9517bbfa (diff)
downloadvim-suse-changes-1fb30f837693b487413c7263dbb6bad0505ca801.tar.gz
fix(abbrevURL): remove rant about sed conditional branching.
Diffstat (limited to 'abbrevURL')
-rwxr-xr-xabbrevURL13
1 files changed, 0 insertions, 13 deletions
diff --git a/abbrevURL b/abbrevURL
index 5c0f6ee..02cc093 100755
--- a/abbrevURL
+++ b/abbrevURL
@@ -9,19 +9,6 @@ else
STR="$1"
fi
-# Conditional branching with exit status ... I am not sure what do I need it for.
-# So for example
-#
-# $ echo "foo.bar" | sed 's/bar.*$//; t; q42' ; echo $?
-# foo.
-# 0
-#
-# whereas
-#
-# $ echo "foo.bar" | sed 's/baz.*$//; t; q42' ; echo $?
-# foo.bar
-# 42
-
STR="$(echo "$STR" | sed -E -e 's@https?://github.com/(.*)/issues/([0-9]+)@gh#\1#\2@')"
STR="$(echo "$STR" | sed -E -e 's@https?://github.com/(.*)/pull/([0-9]+)@gh#\1!\2@')"
STR="$(echo "$STR" | sed -E -e 's@https?://github.com/(.*)/discussions/([0-9]+)@gh#\1\$\2@')"