Skip to content

Instantly share code, notes, and snippets.

@i3p9
Created August 26, 2021 20:01
Show Gist options
  • Save i3p9/aee3a9ad08af4d5c42cd20043200d764 to your computer and use it in GitHub Desktop.
Save i3p9/aee3a9ad08af4d5c42cd20043200d764 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Download Raycast Script
# @raycast.mode silent
# Optional parameters:
# @raycast.icon ⬇️
# @raycast.packageName downloads script from clipboard
# Documentation:
# @raycast.description Downloads copied Raycast Script Command from clipboard
# @raycast.author Fahim Faisal
# @raycast.authorURL https://github.com/i3p9
link=$(pbpaste)
scripts_dir=~/raycastscripts #PUT YOUR OWN Raycast Script Directory here
link=${link/github.com/raw.githubusercontent.com}
link=${link/\/blob/""}
filename=${link##*/}
wget "$link" -P "$TMPDIR"
if grep -q '@raycast.title' "$TMPDIR/$filename"; then
mv "$TMPDIR/$filename" "$scripts_dir"
echo "Raycast script found and downloaded to scripts directory"
else
rm "$TMPDIR/$filename"
echo "No raycast script found!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment