~andrewzah/dotfiles

ref: afee15f824d662f9a3c87f294730c9445a36071e dotfiles/scripts/new-install.sh -rwxr-xr-x 1.1 KiB
afee15f8 — Andrew Zah update install script 2 years ago
                                                                                
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
#!/usr/bin/env bash

logt () {
  echo "##### $text #####"
}

text=""

if [ ! -f ~/.ssh/id_rsa.pub ]; then
  text='Generating SSH Key'
  logt
  ssh-keygen -t RSA -b 4096 -C "zah@andrewzah.com"

  text='Setting ~/.ssh permissions'
  logt
  touch ~/.ssh/authorized_keys
  chmod 700 ~/.ssh
  chmod 644 ~/.ssh/id_rsa.pub
  chmod 0600 ~/.ssh/id_rsa ~/.ssh/authorized_keys

  echo '!!! Dont forget to upload new ssh key to git repo for dotfiles later.'
fi

if [ ! -d ~/.dotfiles ]; then
  text='Cloning dotfiles'
  logt
  git clone -b openbsd-x220 'https://git.sr.ht/~andrewzah/dotfiles' ~/.dotfiles
fi

if [ ! -d ~/.oh-my-zsh ]; then
  text='Downloading Oh-My-Zsh'
  logt
  sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

  echo 'Removing default zshrc'
  rm ~/.zshrc
  ln -s ~/.dotfiles/.zshrc ~/.zshrc
fi

if [ ! -f ~/.local/share/nvim/site/autoload/plug.vim ]; then
  text='Downloading Plug for Neovim'
  logt

  curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi