-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.sh
More file actions
31 lines (26 loc) · 747 Bytes
/
main.sh
File metadata and controls
31 lines (26 loc) · 747 Bytes
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
#!/bin/bash
PBR_DIR="$HOME/personal-bash-resources"
# Detect platform
case "$(uname -s)" in
Darwin) PBR_PLATFORM="macos" ;;
Linux)
if command -v pacman &>/dev/null; then
PBR_PLATFORM="linux-arch"
else
PBR_PLATFORM="linux-unknown"
fi
;;
*) PBR_PLATFORM="unknown" ;;
esac
export PBR_PLATFORM
# Source shared modules
for _pbr_f in "$PBR_DIR/shared"/*.sh; do
[[ -f "$_pbr_f" ]] && source "$_pbr_f"
done
unset _pbr_f
# Source platform-specific modules
if [[ -f "$PBR_DIR/platforms/$PBR_PLATFORM/init.sh" ]]; then
source "$PBR_DIR/platforms/$PBR_PLATFORM/init.sh"
fi
# Source extensions (last — user overrides take priority)
source "$PBR_DIR/extensions/index.sh"