forked from cortensor/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-osx.sh
executable file
·58 lines (48 loc) · 1.99 KB
/
install-osx.sh
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
#!/bin/bash
# Navigate to the directory where the script resides
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $DIR
echo "Starting Cortensor installation process..."
echo "========================================="
echo "1. Setting up directory structure"
# Create necessary directories
mkdir -p ~/bin
mkdir -p ~/.cortensor/logs
mkdir -p ~/bin/llm-files
echo "2. Deploying the Cortensor daemon executable"
# Copy the darwin (macOS) specific Cortensor daemon executable
cp dist/cortensord-darwin ~/bin/cortensord
chmod +x ~/bin/cortensord
echo " - Cortensor daemon copied to ~/bin and made executable"
echo "3. Copying start and stop scripts"
cp utils/start-osx.sh ~/bin/start-cortensor.sh
cp utils/stop-osx.sh ~/bin/stop-cortensor.sh
chmod +x ~/bin/start-cortensor.sh
chmod +x ~/bin/stop-cortensor.sh
echo " - Start and stop scripts copied from utils folder and made executable"
echo "4. Setting up LLM integration"
echo " - Directory ~/bin/llm-files created"
echo "5. Copying environment configuration file"
cp dist/.env-example ~/.cortensor/.env
echo " - Example environment file copied to ~/.cortensor/.env"
echo "6. Creating log files"
touch ~/.cortensor/logs/cortensord.log
touch ~/.cortensor/logs/cortensord-llm.log
echo " - Log files created in ~/.cortensor/logs/"
echo "7. Adding bin directory to PATH"
# Add ~/bin to PATH if not already there
if [[ ":$PATH:" != *":$HOME/bin:"* ]]; then
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bash_profile
echo " - Added ~/bin to PATH in shell configuration files"
fi
echo "========================================="
echo "Cortensor installation completed successfully!"
echo ""
echo "Usage:"
echo " - To start Cortensor: start-cortensor.sh"
echo " - To stop Cortensor: stop-cortensor.sh"
echo " - Logs are available in: ~/.cortensor/logs/"
echo ""
echo "Note: You may need to restart your terminal or run 'source ~/.zshrc'"
echo " (or ~/.bash_profile) to use the commands immediately."