summaryrefslogtreecommitdiff
path: root/oh-my-zsh/plugins/lighthouse
diff options
context:
space:
mode:
authorAditya <bluenerd@protonmail.com>2023-02-27 20:04:56 +0530
committerAditya <bluenerd@protonmail.com>2023-02-27 20:04:56 +0530
commitedc449275b6c04445f58b108ca0937a87c1e8430 (patch)
tree9fd484d58145b616f29a78857cc0b1c8b1c18f05 /oh-my-zsh/plugins/lighthouse
parent6f5424ca96c4221ef433f545642669e9c104d0ed (diff)
add zsh
Diffstat (limited to 'oh-my-zsh/plugins/lighthouse')
-rw-r--r--oh-my-zsh/plugins/lighthouse/README.md29
-rw-r--r--oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh12
2 files changed, 41 insertions, 0 deletions
diff --git a/oh-my-zsh/plugins/lighthouse/README.md b/oh-my-zsh/plugins/lighthouse/README.md
new file mode 100644
index 0000000..55587b2
--- /dev/null
+++ b/oh-my-zsh/plugins/lighthouse/README.md
@@ -0,0 +1,29 @@
+# Lighthouse plugin
+
+This plugin adds commands to manage [Lighthouse](https://lighthouseapp.com/).
+
+To use it, add `lighthouse` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... lighthouse)
+```
+
+## Commands
+
+* `open_lighthouse_ticket <issue>` (alias: `lho`):
+
+ Opens the URL to the issue passed as an argument. To use it, add a `.lighthouse-url`
+ file in your directory with the URL to the individual project.
+
+ Example:
+
+ ```console
+ $ cat .lighthouse-url
+ https://rails.lighthouseapp.com/projects/8994
+
+ $ lho 23
+ Opening ticket #23
+ # The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23
+ ```
+
+See a demo: http://screencast.com/t/ZDgwNDUwNT
diff --git a/oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh b/oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh
new file mode 100644
index 0000000..3fca2bf
--- /dev/null
+++ b/oh-my-zsh/plugins/lighthouse/lighthouse.plugin.zsh
@@ -0,0 +1,12 @@
+open_lighthouse_ticket () {
+ if [ ! -f .lighthouse-url ]; then
+ echo "There is no .lighthouse-url file in the current directory..."
+ return 0
+ fi
+
+ lighthouse_url=$(cat .lighthouse-url)
+ echo "Opening ticket #$1"
+ open_command "$lighthouse_url/tickets/$1"
+}
+
+alias lho='open_lighthouse_ticket'