-
Notifications
You must be signed in to change notification settings - Fork 0
/
.binary_check
41 lines (38 loc) · 1.14 KB
/
.binary_check
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
41
EXPECTED_BINARIES_FILE="$HOME/.expected_binaries"
if [[ ! -f "$EXPECTED_BINARIES_FILE" ]]; then
echo "Expected binaries file not found: $EXPECTED_BINARIES_FILE"
exit 1
fi
missing_binaries=()
while IFS= read -r binary; do
if [[ -z "$binary" || "$binary" =~ ^[[:space:]]*$ ]]; then
continue
fi
if ! command -v "$binary" &>/dev/null; then
missing_binaries+=("$binary")
fi
done <"$EXPECTED_BINARIES_FILE"
if [[ ${#missing_binaries[@]} -ne 0 ]]; then
echo "The following binaries are not installed:"
binaries=""
for binary in "${missing_binaries[@]}"; do
binaries+="\n - \e[31m$binary\e[0m"
done
echo -e "$binaries"
echo -e "\nYour shell experience will probably differ from the intended one."
fi
if command -v delta &> /dev/null; then
eval "$(delta --generate-completion bash)"
ln -sf ~/.gitconfig_delta ~/.gitconfig_delta_active
else
rm -f ~/.gitconfig_delta_active
fi
if command -v fzf >/dev/null 2>&1; then
FZF_ALT_C_COMMAND='' eval "$(fzf --bash)"
fi
if command -v starship >/dev/null 2>&1; then
eval "$(starship init bash)"
fi
if command -v zoxide >/dev/null 2>&1; then
eval "$(zoxide init bash --cmd cd)"
fi