Repository navigation
Expand file tree
/
Copy pathinstall.sh
More file actions
68 lines (55 loc) · 1.42 KB
/
Copy pathinstall.sh
File metadata and controls
68 lines (55 loc) · 1.42 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
62
63
64
65
66
67
68
#!/usr/bin/env bash
set -e
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
install_bash() {
echo "Installing Bash configuration..."
cp "$REPO_DIR/bash/.bash_profile" "$HOME/.bash_profile"
cp "$REPO_DIR/bash/.bashrc" "$HOME/.bashrc"
cp "$REPO_DIR/bash/.bash_aliases" "$HOME/.bash_aliases"
mkdir -p "$HOME/bin"
if [ -d "$REPO_DIR/bash/bin" ]; then
cp "$REPO_DIR/bash/bin/"* "$HOME/bin/" 2>/dev/null || true
chmod +x "$HOME/bin/"* 2>/dev/null || true
fi
echo "Bash configuration installed."
}
install_git() {
echo "Installing Git configuration..."
# cp "$REPO_DIR/git/.gitconfig" "$HOME/.gitconfig"
cp "$REPO_DIR/git/.gitignore_global" "$HOME/.gitignore_global"
echo "Git configuration installed."
}
show_usage() {
echo "Usage:"
echo " ./install.sh bash"
echo " ./install.sh git"
echo " ./install.sh bash git"
echo " ./install.sh all"
}
if [ "$#" -eq 0 ]; then
show_usage
exit 1
fi
for target in "$@"; do
case "$target" in
bash)
install_bash
;;
git)
install_git
;;
all)
install_bash
install_git
;;
*)
echo "Unknown install target: $target"
show_usage
exit 1
;;
esac
done
echo ""
echo "Install complete."
echo "Open a new Git Bash window, or run:"
echo "source ~/.bashrc"