-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·86 lines (76 loc) · 2.66 KB
/
install.sh
File metadata and controls
executable file
·86 lines (76 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# One-line installer for GPT Rewriter Raycast Extension
# Usage: curl -fsSL https://raw.githubusercontent.com/alshimo/GPTRewriter/main/install.sh | bash
# Or: bash <(curl -fsSL https://raw.githubusercontent.com/alshimo/GPTRewriter/main/install.sh)
set -e
REPO_URL="https://github.com/alshimo/GPTRewriter.git"
INSTALL_DIR="$HOME/.raycast-extensions/GPTRewriter"
echo "🚀 Installing GPT Rewriter Raycast Extension"
echo "=============================================="
echo ""
# Check if Raycast extensions directory exists
if [ ! -d "$HOME/.raycast-extensions" ]; then
echo "📁 Creating Raycast extensions directory..."
mkdir -p "$HOME/.raycast-extensions"
fi
# Check if already installed
if [ -d "$INSTALL_DIR" ]; then
echo "⚠️ Extension already exists at $INSTALL_DIR"
read -p "Do you want to update it? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "🔄 Updating extension..."
cd "$INSTALL_DIR"
if [ -d ".git" ]; then
git pull origin main
else
rm -rf "$INSTALL_DIR"
git clone "$REPO_URL" "$INSTALL_DIR"
fi
else
echo "❌ Installation cancelled."
exit 1
fi
else
echo "📥 Cloning repository..."
git clone "$REPO_URL" "$INSTALL_DIR"
fi
cd "$INSTALL_DIR"
# Check requirements
echo ""
echo "🔍 Checking requirements..."
if [ -f "./check-requirements.sh" ]; then
chmod +x ./check-requirements.sh
./check-requirements.sh
fi
# Run setup
echo ""
echo "⚙️ Running setup..."
if [ -f "./setup.sh" ]; then
chmod +x ./setup.sh
./setup.sh
else
echo "📦 Installing dependencies..."
npm install
fi
echo ""
echo "✅ Installation complete!"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📝 NEXT STEPS:"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "1. Start development mode:"
echo " cd $INSTALL_DIR"
echo " npm run dev"
echo ""
echo " This will automatically load the extension in Raycast."
echo " Keep this terminal window open while using the extension."
echo ""
echo "2. Configure API Keys:"
echo " - In Raycast, type 'Settings' (from GPT Rewriter)"
echo " - Add your OpenAI API Key"
echo " - Optionally add OpenRouter API Key"
echo ""
echo "📖 For more help, see: $INSTALL_DIR/INSTALLATION.md"
echo ""