Merge pull request #2 from capitolgrape/master

feat: Enhance Arch script by checking if paru is installed.
This commit is contained in:
Yusuf İpek
2025-11-23 12:38:32 +03:00
committed by GitHub
+19 -12
View File
@@ -1,4 +1,4 @@
import { SelectedPackage, Platform, GeneratedScript } from '@/types' import { GeneratedScript, Platform, SelectedPackage } from '@/types'
export function generateScript(packages: SelectedPackage[], platform: Platform): GeneratedScript { export function generateScript(packages: SelectedPackage[], platform: Platform): GeneratedScript {
const script = createScriptContent(packages, platform) const script = createScriptContent(packages, platform)
@@ -110,14 +110,22 @@ set -e
echo "Starting package installation for Arch Linux..." echo "Starting package installation for Arch Linux..."
# Check if yay is installed AUR_HELPER=""
if ! command -v yay &> /dev/null; then
echo "yay is not installed. Installing yay..." # Check for paru or yay
if command -v paru &> /dev/null; then
echo "paru detected."
AUR_HELPER="paru"
elif command -v yay &> /dev/null; then
echo "yay detected."
AUR_HELPER="yay"
else
echo "Neither paru nor yay is installed. Installing yay..."
# Install dependencies # Install dependencies
echo "Installing dependencies..." echo "Installing dependencies..."
sudo pacman -S --needed --noconfirm git base-devel sudo pacman -S --needed --noconfirm git base-devel
# Clone and build yay # Clone and build yay
echo "Building yay..." echo "Building yay..."
git clone https://aur.archlinux.org/yay-bin.git git clone https://aur.archlinux.org/yay-bin.git
@@ -125,19 +133,18 @@ if ! command -v yay &> /dev/null; then
makepkg -si --noconfirm makepkg -si --noconfirm
cd .. cd ..
rm -rf yay-bin rm -rf yay-bin
echo "yay installed successfully!" echo "yay installed successfully!"
else AUR_HELPER="yay"
echo "yay is already installed."
fi fi
# Update package lists # Update package lists
echo "Updating package lists..." echo "Updating package lists with $AUR_HELPER..."
yay -Sy --noconfirm $AUR_HELPER -Sy --noconfirm
# Install packages # Install packages
echo "Installing packages: ${packageNames}" echo "Installing packages: ${packageNames}"
yay -S --noconfirm ${packageNames} $AUR_HELPER -S --noconfirm ${packageNames}
# Verify installation # Verify installation
echo "Verifying installation..." echo "Verifying installation..."