-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
executable file
·40 lines (32 loc) · 1.02 KB
/
installer.sh
File metadata and controls
executable file
·40 lines (32 loc) · 1.02 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
#!/usr/bin/env bash
set -euo pipefail
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
PKG_DIR="$DOTFILES_DIR/packages"
PACKAGE_LIST_FILE="$DOTFILES_DIR/package-list.txt"
echo ""
echo "================================"
echo "= ASHAR Dotfiles Installer ="
echo "================================"
echo ""
# Make sure the system is up to date
sudo pacman -Syu --noconfirm
# Read packages from package-list.txt (comma-separated)
# Read and clean packages from the comma-separated list
mapfile -t PACKAGES < <(tr -d '\r\n' < "$PACKAGE_LIST_FILE" | tr ',' '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
# Loop over packages in the order defined
for name in "${PACKAGES[@]}"; do
script="$PKG_DIR/$name.sh"
if [[ ! -f "$script" ]]; then
echo "❌ Error: Installer for $name not found at $script"
exit 1
fi
echo ""
echo "→ Installing $name..."
bash "$script"
done
echo ""
echo "=== All packages installed ==="
echo ""
# Apply symlinks
echo "→ Applying config symlinks..."
bash "$DOTFILES_DIR/link.sh"