1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 15:04:42 +00:00

Merge pull request #211 from thijsvanhal/main

feat: enhance raycast quick launcher setup script
This commit is contained in:
Tw93
2025-12-30 23:01:58 +08:00
committed by GitHub

View File

@@ -18,6 +18,7 @@ log_step() { echo -e "${BLUE}${ICON_STEP}${NC} $1"; }
log_success() { echo -e "${GREEN}${ICON_SUCCESS}${NC} $1"; } log_success() { echo -e "${GREEN}${ICON_SUCCESS}${NC} $1"; }
log_warn() { echo -e "${YELLOW}${ICON_WARN}${NC} $1"; } log_warn() { echo -e "${YELLOW}${ICON_WARN}${NC} $1"; }
log_error() { echo -e "${RED}${ICON_ERR}${NC} $1"; } log_error() { echo -e "${RED}${ICON_ERR}${NC} $1"; }
log_header() { echo -e "\n${BLUE}==== $1 ====${NC}\n"; }
detect_mo() { detect_mo() {
if command -v mo > /dev/null 2>&1; then if command -v mo > /dev/null 2>&1; then
@@ -247,18 +248,38 @@ create_raycast_commands() {
log_success "Scripts ready in: $dir" log_success "Scripts ready in: $dir"
done done
echo "" log_header "Raycast Configuration"
if open "raycast://extensions/script-commands" > /dev/null 2>&1; then if open "raycast://extensions/raycast/raycast-settings/extensions" > /dev/null 2>&1; then
log_step "Raycast settings opened." log_step "Raycast settings opened."
else else
log_warn "Could not auto-open Raycast." log_warn "Could not auto-open Raycast."
fi fi
echo "" for dir in "${dirs[@]}"; do
echo "Next steps to activate Raycast commands:" if [ ! -d "$dir" ]; then
echo " 1. Open Raycast (⌘ Space)" echo "Skipping: $dir (Directory does not exist)"
echo " 2. Search for 'Reload Script Directories'" continue
echo " 3. Press Enter to load new commands" fi
echo -n "$dir" | pbcopy
echo ""
echo "--- Action Required for folder: $(basename "$dir") ---"
echo "1. In the Raycast Extensions window, click the '+' icon."
echo "2. Select 'Add Script Directory'."
echo "3. A folder picker will open. Press: Shift + Command + G (⇧⌘G)."
echo "4. Paste the path (manually) that is copied to your clipboard and press Enter."
echo "5. Open / select the folder to confirm."
echo ""
echo "Path copied to your clipboard: $dir"
read -r -p "Press [Enter] once you have added this folder..."
done
log_header "Finalizing Setup"
read -r -p "In Raycast we need to reload the script directories to sync your new commands. Press [Enter] to reload..."
open "raycast://extensions/raycast/raycast/reload-script-directories"
log_success "Raycast setup complete!"
} }
uuid() { uuid() {