Fedora Setup
This commit is contained in:
45
scripts/r.sh
45
scripts/r.sh
@@ -9,30 +9,38 @@ GREEN='\033[1;32m'
|
||||
RED='\033[1;31m'
|
||||
NC='\033[0m'
|
||||
|
||||
# OS Detection
|
||||
if [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
OS=$ID
|
||||
fi
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
source "$SCRIPT_DIR/lib/distro.sh"
|
||||
|
||||
echo -e "${BLUE} LOG:${YELLOW} Detecting R installation strategy for $OS...${NC}"
|
||||
|
||||
if [ "$OS" == "arch" ] || [ "$OS" == "manjaro" ]; then
|
||||
if is_arch_family; then
|
||||
|
||||
echo -e "${BLUE} LOG:${YELLOW} Arch Linux detected. Using system R (Pacman)...${NC}"
|
||||
|
||||
# Install R + Build Tools
|
||||
sudo pacman -S --noconfirm --needed r gcc-fortran curl tar
|
||||
install_status=0
|
||||
install_packages r gcc-fortran curl tar || install_status=$?
|
||||
if [ "$install_status" -eq 42 ]; then
|
||||
exit 0
|
||||
elif [ "$install_status" -ne 0 ]; then
|
||||
exit "$install_status"
|
||||
fi
|
||||
|
||||
echo -e "${GREEN} SUCCESS:${NC} R installed via Pacman."
|
||||
|
||||
R_BIN="R"
|
||||
|
||||
elif [ "$OS" == "ubuntu" ] || [ "$OS" == "debian" ]; then
|
||||
elif is_debian_family; then
|
||||
|
||||
echo -e "${BLUE} LOG:${YELLOW} Installing Debian build dependencies...${NC}"
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get update
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y gfortran curl tar ca-certificates
|
||||
install_status=0
|
||||
install_packages gfortran curl tar ca-certificates || install_status=$?
|
||||
if [ "$install_status" -eq 42 ]; then
|
||||
exit 0
|
||||
elif [ "$install_status" -ne 0 ]; then
|
||||
exit "$install_status"
|
||||
fi
|
||||
|
||||
if ! command -v rig >/dev/null 2>&1; then
|
||||
echo -e "${BLUE} LOG:${YELLOW} Installing Rig for Debian/Ubuntu...${NC}"
|
||||
@@ -69,6 +77,23 @@ elif [ "$OS" == "ubuntu" ] || [ "$OS" == "debian" ]; then
|
||||
fi
|
||||
|
||||
R_BIN="rig run"
|
||||
|
||||
elif is_fedora_family; then
|
||||
|
||||
echo -e "${BLUE} LOG:${YELLOW} Fedora detected. Using system R...${NC}"
|
||||
install_status=0
|
||||
install_packages R gcc-gfortran curl tar || install_status=$?
|
||||
if [ "$install_status" -eq 42 ]; then
|
||||
exit 0
|
||||
elif [ "$install_status" -ne 0 ]; then
|
||||
exit "$install_status"
|
||||
fi
|
||||
|
||||
R_BIN="R"
|
||||
|
||||
else
|
||||
echo -e "${RED} ERROR:${NC} Unsupported OS: $OS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${BLUE} LOG:${YELLOW} Installing 'renv' package globally...${NC}"
|
||||
|
||||
Reference in New Issue
Block a user