-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·111 lines (93 loc) · 2.79 KB
/
Copy pathinstall
File metadata and controls
executable file
·111 lines (93 loc) · 2.79 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env zsh
set -eu
source "${HOME}/dotfiles/lib/common.zsh"
# Basic setup
dotmsg "preparing directories..."
mkdir -p ~/code
mkdir -p ~/.config
mkdir -p ~/local
# zsh
zsh_path=`which zsh`
log_todo "Ensure zsh in /etc/shells and set default shell:
chsh -s ${zsh_path}"
dotmsg "configuring zsh..."
zshenv=$HOME/.zshenv
zdotdir=$DOTFILES/zsh
zpreztodir=$zdotdir/.zprezto
# rewrite zshenv with our settings
[[ -s $zshenv ]] && rm -f $zshenv
echo 'ZDOTDIR="'$zdotdir'"' > $zshenv
# platform specific setup: macOS vs linux
if is_macos; then
dotmsg "performing macOS setup..."
source "${DOTFILES}/lib/install-mac.zsh"
else
dotmsg "performing Linux setup..."
source "${DOTFILES}/lib/install-linux.zsh"
fi
# Prezto + prezto-contrib
if [ ! -d $zpreztodir ]; then
dotmsg "installing prezto..."
git clone --recursive https://github.com/sorin-ionescu/prezto.git $zpreztodir
git clone --recurse-submodules https://github.com/belak/prezto-contrib $zpreztodir/contrib
fi
# Upgrade spaceship prompt to v4 (prezto-contrib ships with v3)
spaceship_dir=$zpreztodir/contrib/contrib-prompt/external/spaceship
spaceship_version_file=$spaceship_dir/.spaceship-v4
if [ ! -f $spaceship_version_file ]; then
dotmsg "upgrading spaceship prompt to v4..."
rm -rf $spaceship_dir
git clone --depth 1 --branch v4.9.1 https://github.com/spaceship-prompt/spaceship-prompt.git $spaceship_dir
rm -rf $spaceship_dir/.git
touch $spaceship_version_file
fi
dotmsg "configuring vim..."
rm -f ~/.vimrc
ln -s $DOTFILES/vim/.vimrc $HOME/.vimrc
# git
gitcfg=$HOME/.gitconfig
if [ ! -s $gitcfg ]; then
dotmsg "setting up git config"
echo "[include]
path = $DOTFILES/git/config" > $gitcfg
log_todo "remember to configure an email for git:
git config --global user.email 'your.email@example.com'"
fi
# mise (tool version manager)
mise_bin="${HOME}/.local/bin/mise"
if [ ! -f $mise_bin ]; then
dotmsg "installing mise..."
curl https://mise.run | sh
fi
mise_tools=(
"python"
"node"
"go"
)
for tool in $mise_tools; do
if mise which $tool >/dev/null 2>&1; then
continue
fi
dotmsg "mise: $tool plugin available..."
log_todo "to install $tool versions:
mise use --global $tool@latest
# or specific version: mise use --global $tool@X.Y.Z"
done
# atuin
atuin_bin="${HOME}/.atuin/bin/atuin"
if [ ! -f $atuin_bin ]; then
dotmsg "installing atuin..."
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
dotmsg "importing shell history to atuin..."
$atuin_bin import auto
else
dotmsg "atuin already installed"
fi
dotmsg "configuring atuin..."
atuin_config_dir="${HOME}/.config/atuin"
atuin_config="${atuin_config_dir}/config.toml"
mkdir -p $atuin_config_dir
rm -f $atuin_config
ln -s $DOTFILES/atuin/config.toml $atuin_config
log_todo "Restart shell for all changes to take effect"
print_result