mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 18:05:05 +00:00
fix: reduce raycast setup prompts after first run
This commit is contained in:
@@ -28,6 +28,7 @@ prompt_enter() {
|
|||||||
echo "$prompt"
|
echo "$prompt"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
RAYCAST_HINT_FILE="$HOME/.config/mole/raycast_script_dirs_added"
|
||||||
|
|
||||||
detect_mo() {
|
detect_mo() {
|
||||||
if command -v mo > /dev/null 2>&1; then
|
if command -v mo > /dev/null 2>&1; then
|
||||||
@@ -264,6 +265,9 @@ create_raycast_commands() {
|
|||||||
log_warn "Could not auto-open Raycast."
|
log_warn "Could not auto-open Raycast."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$RAYCAST_HINT_FILE" ]]; then
|
||||||
|
echo "Raycast script directories already configured. Skipping manual setup."
|
||||||
|
else
|
||||||
for dir in "${dirs[@]}"; do
|
for dir in "${dirs[@]}"; do
|
||||||
if [ ! -d "$dir" ]; then
|
if [ ! -d "$dir" ]; then
|
||||||
echo "Skipping: $dir (Directory does not exist)"
|
echo "Skipping: $dir (Directory does not exist)"
|
||||||
@@ -284,6 +288,12 @@ create_raycast_commands() {
|
|||||||
prompt_enter "Press [Enter] once you have added this folder..."
|
prompt_enter "Press [Enter] once you have added this folder..."
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if is_interactive; then
|
||||||
|
mkdir -p "$(dirname "$RAYCAST_HINT_FILE")"
|
||||||
|
touch "$RAYCAST_HINT_FILE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
log_header "Finalizing Setup"
|
log_header "Finalizing Setup"
|
||||||
prompt_enter "In Raycast we need to reload the script directories to sync your new commands. Press [Enter] to reload..."
|
prompt_enter "In Raycast we need to reload the script directories to sync your new commands. Press [Enter] to reload..."
|
||||||
if open "raycast://extensions/raycast/raycast/reload-script-directories" > /dev/null 2>&1; then
|
if open "raycast://extensions/raycast/raycast/reload-script-directories" > /dev/null 2>&1; then
|
||||||
|
|||||||
Reference in New Issue
Block a user