From afa0cdecc117eec458fd2d9621c5fcc1819b116d Mon Sep 17 00:00:00 2001 From: Daniel Miessler Date: Thu, 12 Sep 2024 08:36:06 -0700 Subject: [PATCH] Added yt raycast script. --- patterns/raycast/yt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 patterns/raycast/yt diff --git a/patterns/raycast/yt b/patterns/raycast/yt new file mode 100644 index 0000000..c48c32a --- /dev/null +++ b/patterns/raycast/yt @@ -0,0 +1,28 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Extract YouTube Info +# @raycast.mode fullOutput + +# Optional parameters: +# @raycast.icon 📹 +# @raycast.argument1 { "type": "text", "placeholder": "YouTube link", "optional": false, "percentEncoded": true } + +# Documentation: +# @raycast.description Run fabric yt on a YouTube link +# @raycast.author Daniel Miessler +# @raycast.authorURL https://github.com/danielmiessler + +# Set PATH to include common locations and $HOME/go/bin +PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/go/bin:$PATH" + +# Use the PATH to find and execute fabric +if command -v fabric >/dev/null 2>&1; then + fabric -sp yt "${1}" +else + echo "Error: fabric command not found in PATH" + echo "Current PATH: $PATH" + exit 1 +fi +