Files
SIA/scripts/install.sh
2025-04-01 11:49:21 +00:00

36 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
add_to_environment() {
local path="$1"
# Check if the path is already in the environment file
if ! grep -q "$path" /etc/environment; then
# Get current PATH from environment file
current_path=$(grep "^PATH=" /etc/environment | cut -d'"' -f2)
if [ -z "$current_path" ]; then
# If PATH doesn't exist in the file, create it
echo "PATH=\"\$PATH:$path\"" >> /etc/environment
else
# Replace existing PATH line with updated one
sed -i "s|^PATH=.*|PATH=\"$path:$current_path\"|" /etc/environment
fi
fi
}
echo "Installing ITB tool..."
python3 -m venv "/root/venvs/itb"
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb/
add_to_environment "/root/venvs/itb/bin"
echo "Installing Train tool..."
python3 -m venv "/root/venvs/train"
/root/venvs/train/bin/pip install -e /root/sia/tools/train/
/root/venvs/train/bin/ipython kernel install --name=train
add_to_environment "/root/venvs/train/bin"
echo "Installing SIA core..."
python3 -m venv "/root/venvs/sia"
/root/venvs/sia/bin/pip install -e /root/sia/
add_to_environment "/root/venvs/sia/bin"
source "/etc/environment