-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_google_sheets.sh
More file actions
executable file
·58 lines (51 loc) · 1.81 KB
/
setup_google_sheets.sh
File metadata and controls
executable file
·58 lines (51 loc) · 1.81 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
#!/bin/bash
# Interactive script to help set up Google Sheets export
echo "=========================================="
echo "Google Sheets Export Setup Helper"
echo "=========================================="
echo ""
# Check if credentials already exist
if [ -f "credentials.json" ]; then
echo "✅ Found credentials.json in project root"
echo ""
read -p "Do you want to use this file? (y/n): " use_existing
if [ "$use_existing" = "y" ] || [ "$use_existing" = "Y" ]; then
echo "✅ Using existing credentials.json"
exit 0
fi
fi
echo "To enable Google Sheets export, you need to:"
echo ""
echo "1. Create a Google Cloud project"
echo "2. Enable Google Sheets API"
echo "3. Create a service account"
echo "4. Download credentials JSON"
echo ""
echo "📖 Full instructions: See GOOGLE_SHEETS_SETUP.md"
echo ""
read -p "Press Enter to open Google Cloud Console..."
echo ""
# Try to open browser
if command -v xdg-open > /dev/null; then
xdg-open "https://console.cloud.google.com/apis/library/sheets.googleapis.com" 2>/dev/null &
elif command -v open > /dev/null; then
open "https://console.cloud.google.com/apis/library/sheets.googleapis.com" 2>/dev/null &
else
echo "Please open: https://console.cloud.google.com/apis/library/sheets.googleapis.com"
fi
echo ""
echo "After you download the credentials JSON file:"
echo ""
read -p "Enter the path to your downloaded credentials JSON file: " creds_path
if [ -f "$creds_path" ]; then
cp "$creds_path" "$(pwd)/credentials.json"
echo "✅ Copied credentials to $(pwd)/credentials.json"
echo ""
echo "You can now run:"
echo " python3 export_to_google_sheets.py --factory sentai"
else
echo "❌ File not found: $creds_path"
echo ""
echo "Please manually copy your credentials JSON to:"
echo " $(pwd)/credentials.json"
fi