Skip to content

Commit

Permalink
Add linear script
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewitteman committed Jul 26, 2024
1 parent 54986b7 commit a2a24ae
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions home/exact_dot_scripts/executable_linear
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -o errexit

while [ "$#" -gt 0 ]; do
case "$1" in
-h | --help)
echo "usage: $(basename "$0")"
echo
echo "cleans up the url that's on the clipboard"
exit
;;
--)
shift
break
;;
-?*) die 1 "unknown option: ${1}" ;;
*) break ;;
esac
shift
done

if pbpaste | grep --extended-regexp --only-matching 'https:\/\/linear.app\/\w+\/issue\/([A-Z])+-\d+' >/dev/null; then
pbpaste | grep --extended-regexp --only-matching 'https:\/\/linear.app\/\w+\/issue\/([A-Z])+-\d+' | tee /dev/stderr | pbcopy
else
echo "not a valid linear url in the clipboard" >&2
fi

0 comments on commit a2a24ae

Please sign in to comment.