mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 13:16:47 +00:00
Optimize the installation experience of raycast
This commit is contained in:
@@ -70,8 +70,8 @@ Install Raycast integration with one command:
|
||||
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/integrations/setup-raycast.sh | bash
|
||||
```
|
||||
|
||||
After installation, open Raycast, search for `Reload Script Directories`, then look for `clean mac`.
|
||||
If nothing shows up, open `Raycast Settings → Extensions → Script Commands`, click `Add Directories`, and point it to `~/Documents/Raycast/Scripts`.
|
||||
The installer drops scripts into both `~/Documents/Raycast/Scripts` and `~/Library/Application Support/Raycast/script-commands`, so Raycast should detect at least one automatically.
|
||||
If you still do not see `clean mac`, open `Raycast Settings → Extensions → Script Commands`, click `Add Directories`, and pick whichever of those two folders you prefer.
|
||||
|
||||
For Alfred and macOS Shortcuts, see [integrations/README.md](integrations/README.md).
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ One command install:
|
||||
curl -fsSL https://raw.githubusercontent.com/tw93/Mole/main/integrations/setup-raycast.sh | bash
|
||||
```
|
||||
|
||||
Then open Raycast and search "Reload Script Directories".
|
||||
The installer copies scripts into both `~/Documents/Raycast/Scripts` and `~/Library/Application Support/Raycast/script-commands`. After installation, open Raycast and search "Reload Script Directories".
|
||||
|
||||
If the commands still do not appear, go to `Raycast Settings → Extensions → Script Commands`, click `Add Directories`, and add `~/Documents/Raycast/Scripts`.
|
||||
Still nothing? Go to `Raycast Settings → Extensions → Script Commands`, click `Add Directories`, and select either of those folders.
|
||||
|
||||
Available commands: `clean mac`, `dry run`, `uninstall apps`
|
||||
|
||||
@@ -42,4 +42,5 @@ Then add to Menu Bar or assign a keyboard shortcut.
|
||||
|
||||
```bash
|
||||
rm -rf ~/Documents/Raycast/Scripts/mole-*.sh
|
||||
rm -rf ~/Library/Application\ Support/Raycast/script-commands/mole-*.sh
|
||||
```
|
||||
|
||||
@@ -4,28 +4,57 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BLUE='\033[0;34m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m'
|
||||
|
||||
RAYCAST_DIR="$HOME/Documents/Raycast/Scripts"
|
||||
BASE_URL="https://raw.githubusercontent.com/tw93/Mole/main/integrations/raycast"
|
||||
ICON_STEP="➜"
|
||||
ICON_SUCCESS="✓"
|
||||
ICON_WARN="!"
|
||||
ICON_ERR="✗"
|
||||
|
||||
# Check Raycast
|
||||
log_step() { echo -e "${BLUE}${ICON_STEP}${NC} $1"; }
|
||||
log_success() { echo -e "${GREEN}${ICON_SUCCESS}${NC} $1"; }
|
||||
log_warn() { echo -e "${YELLOW}${ICON_WARN}${NC} $1"; }
|
||||
log_error() { echo -e "${RED}${ICON_ERR}${NC} $1"; }
|
||||
|
||||
RAYCAST_DIRS=(
|
||||
"$HOME/Documents/Raycast/Scripts"
|
||||
"$HOME/Library/Application Support/Raycast/script-commands"
|
||||
)
|
||||
BASE_URL="https://raw.githubusercontent.com/tw93/Mole/main/integrations/raycast"
|
||||
SCRIPTS=(mole-clean.sh mole-clean-dry-run.sh mole-uninstall.sh)
|
||||
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo " Mole × Raycast Script Commands"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
log_step "Checking Raycast installation..."
|
||||
if [[ ! -d "/Applications/Raycast.app" ]]; then
|
||||
echo -e "${YELLOW}Raycast not found. Install from: https://raycast.com${NC}"
|
||||
log_warn "Raycast not found. Install it from https://raycast.com"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing Mole commands for Raycast..."
|
||||
mkdir -p "$RAYCAST_DIR"
|
||||
|
||||
# Download scripts
|
||||
for script in mole-clean.sh mole-clean-dry-run.sh mole-uninstall.sh; do
|
||||
curl -fsSL "$BASE_URL/$script" -o "$RAYCAST_DIR/$script"
|
||||
chmod +x "$RAYCAST_DIR/$script"
|
||||
log_step "Syncing scripts (${#SCRIPTS[@]}) to Raycast directories..."
|
||||
for dir in "${RAYCAST_DIRS[@]}"; do
|
||||
mkdir -p "$dir"
|
||||
for script in "${SCRIPTS[@]}"; do
|
||||
curl -fsSL "$BASE_URL/$script" -o "$dir/$script"
|
||||
chmod +x "$dir/$script"
|
||||
done
|
||||
log_success "Scripts ready in: $dir"
|
||||
done
|
||||
|
||||
echo -e "${GREEN}✓${NC} Installed! Open Raycast and search: 'Reload Script Directories'"
|
||||
echo ""
|
||||
echo "Then search for: 'Clean Mac'"
|
||||
log_success "All set! Next steps:"
|
||||
cat <<'INSTRUCTIONS'
|
||||
1. Open Raycast and run "Reload Script Directories".
|
||||
2. Search for "Clean Mac" / "Dry Run" / "Uninstall Apps".
|
||||
3. Missing? Open Raycast Settings → Extensions → Script Commands
|
||||
and add either folder listed above.
|
||||
INSTRUCTIONS
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user