-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·83 lines (71 loc) · 2.09 KB
/
setup.sh
File metadata and controls
executable file
·83 lines (71 loc) · 2.09 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
#!/bin/bash
# LiveLink Setup Script
echo "LiveLink Setup Script"
echo "====================="
echo ""
# Check if .env file exists
if [ -f .env ]; then
echo "Found existing .env file."
read -p "Do you want to update it? (y/n): " update_env
if [[ $update_env != "y" ]]; then
echo "Skipping .env update."
else
update_env="y"
fi
else
echo "No .env file found. Creating one..."
touch .env
update_env="y"
fi
# Update .env file if needed
if [[ $update_env == "y" ]]; then
echo ""
echo "Setting up API keys..."
echo ""
# Get Holodex API key
read -p "Enter your Holodex API key (get from https://holodex.net/api): " holodex_key
if [[ -n $holodex_key ]]; then
grep -v "HOLODEX_API_KEY" .env > .env.tmp
echo "HOLODEX_API_KEY=$holodex_key" >> .env.tmp
mv .env.tmp .env
echo "Holodex API key set."
else
echo "Holodex API key not set. Streams from Holodex will not be available."
fi
# Get Twitch API keys
read -p "Enter your Twitch Client ID (get from https://dev.twitch.tv/console/apps): " twitch_id
read -p "Enter your Twitch Client Secret: " twitch_secret
if [[ -n $twitch_id && -n $twitch_secret ]]; then
grep -v "TWITCH_CLIENT_ID" .env > .env.tmp
echo "TWITCH_CLIENT_ID=$twitch_id" >> .env.tmp
mv .env.tmp .env
grep -v "TWITCH_CLIENT_SECRET" .env > .env.tmp
echo "TWITCH_CLIENT_SECRET=$twitch_secret" >> .env.tmp
mv .env.tmp .env
echo "Twitch API keys set."
else
echo "Twitch API keys not set. Streams from Twitch will not be available."
fi
fi
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo ""
echo "Installing dependencies..."
npm install
else
echo ""
echo "Dependencies already installed."
fi
# Build the server
echo ""
echo "Building the server..."
npm run build:server
echo ""
echo "Setup complete!"
echo ""
echo "To start the server, run: npm start"
echo "To start the development server, run: npm run dev"
echo ""
echo "If you encounter any issues with streams not loading, check the logs for error messages."
echo "Make sure your API keys are correctly set in the .env file."
echo ""