-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·61 lines (46 loc) · 1.21 KB
/
setup.sh
File metadata and controls
executable file
·61 lines (46 loc) · 1.21 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
has_omf() {
if [ -d "$HOME/.local/share/omf" ]; then
return 0
fi
if [ -f "$HOME/.config/fish/functions/omf.fish" ]; then
return 0
fi
return 1
}
check_required_tools() {
local tools=("git" "fish" "fzf")
local missing=()
for tool in "${tools[@]}"; do
if ! command -v "$tool" &> /dev/null; then
missing+=("$tool")
else
echo -e "✓ $tool is installed"
fi
done
if ! has_omf; then
missing+=("omf")
else
echo -e "✓ omf is installed"
fi
if [ ${#missing[@]} -gt 0 ]; then
echo -e "ERROR: The following required tools are not installed:"
printf " - %s\n" "${missing[@]}"
exit 1
fi
echo -e "✓ All required tools are installed"
}
main () {
check_required_tools
echo -e "configuring $HOME/.config/fish/config.fish"
[ ! -d "$HOME/.config/fish" ] && mkdir -p "$HOME/.config/fish"
cp ./.config/fish/config.fish "$HOME/.config/fish/config.fish"
echo -e "configuring $HOME/.gitconfig"
cp ./.gitconfig "$HOME/.gitconfig"
echo -e "configuring $HOME/.gitignore_global"
cp ./.gitignore_global "$HOME/.gitignore_global"
echo -e "configuring $HOME/.nanorc"
cp ./.nanorc "$HOME/.nanorc"
echo -e "✓ Configuration complete"
}
main