From a2a24ae7932db5e4bd50644bb343ff6c57afbadc Mon Sep 17 00:00:00 2001 From: George Witteman Date: Fri, 26 Jul 2024 14:56:24 -0400 Subject: [PATCH] Add linear script --- home/exact_dot_scripts/executable_linear | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 home/exact_dot_scripts/executable_linear diff --git a/home/exact_dot_scripts/executable_linear b/home/exact_dot_scripts/executable_linear new file mode 100644 index 0000000..e70aaae --- /dev/null +++ b/home/exact_dot_scripts/executable_linear @@ -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