-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitdotfiles.sh
More file actions
executable file
·40 lines (33 loc) · 1.34 KB
/
initdotfiles.sh
File metadata and controls
executable file
·40 lines (33 loc) · 1.34 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
REPO_URL="${REPO_URL:-"https://github.com/binaryaaron/dotfiles.git"}"
DOTFILES="${DOTFILES:-"$HOME/dotfiles"}"
export DOTFILES
shell_type=$(basename "$SHELL")
email="${EMAIL:-$1}"
name="${NAME:-${2:-}}"
signingkey="${SIGNINGKEY:-${3:-}}"
if [ -z "$email" ]; then
echo "usage: $0 <email> [name] [signingkey] or EMAIL=you@example.com $0" >&2
exit 1
fi
if [ ! -d "$DOTFILES" ]; then
git clone "$REPO_URL" "$DOTFILES"
fi
. "$DOTFILES/shells/utils.sh"
. "$DOTFILES/shells/envvars.sh" || echo "failed to source envvars."
. "$DOTFILES/shells/xdg_home/init_xdg_stuff.sh" || echo "failed to source xdg_home"
. "$DOTFILES/shells/gitconfigs/init_gitconfig.sh" || echo "failed to source gitconfig"
init_xdg_home
setup_gitconfig "$email" "$name" "$signingkey" || echo "failed to setup gitconfig"
(command -v starship > /dev/null 2>&1 ||
FORCE=1 curl -sS https://starship.rs/install.sh | sh
)
(command -v atuin > /dev/null 2>&1 ||
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
)
echo "symlinking shell rc files"
_safe_symlink "$DOTFILES/shells/.bashrc" "$HOME/.bashrc"
_safe_symlink "$DOTFILES/shells/.bash_profile" "$HOME/.bash_profile"
_safe_symlink "$DOTFILES/shells/.bashenv" "$HOME/.bashenv"
_safe_symlink "$DOTFILES/shells/.zshrc" "$HOME/.zshrc"
_safe_symlink "$DOTFILES/shells/.dircolors" "$HOME/.dircolors"