-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
47 lines (39 loc) · 1.69 KB
/
init.sh
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
#!/bin/bash
dry_run=false
while getopts 'hn' opt; do
case "$opt" in
n) dry_run=true ;;
h|*) echo "usage $0 [flags]" >&2
echo ' -n dry-run' >&2
echo ' -h help' >&2
exit 1 ;;
esac
done
if "$dry_run"; then
cmd=echo
else
cmd=''
fi
echo "Installing homebrew..."
$cmd /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "Installing homebrew...done"
echo "Installing tools using brew command..."
$cmd brew install ansible bento4 ffmpeg ghostscript git helm imagemagick jq k9s kubernetes-cli nvm pipenv pipx poppler powerlevel10k pulumi [email protected] [email protected] telnet terraform ufraw virtualenv virtualenvwrapper watch
echo "Installing tools using brew command...done"
echo "Installing node v18 and npm global packages..."
$cmd nvm install 18
$cmd npm install -g iterm2-tab-set
echo "Installing node v18 and npm global packages...done"
read -e -p "Public key [~/.ssh/achernar.pub]: " PUBKEY_FILEPATH
PUBKEY_FILEPATH=${PUBKEY_FILEPATH:-~/.ssh/achernar.pub}
[ -f $PUBKEY_FILEPATH ] && echo "Public key $PUBKEY_FILEPATH exists." || { echo "Public key $PUBKEY_FILEPATH does not exist." && exit 1 ;}
read -e -p "Private key [~/.ssh/achernar]: " PRIVKEY_FILEPATH
PRIVKEY_FILEPATH=${PRIVKEY_FILEPATH:-~/.ssh/achernar}
[ -f $PRIVKEY_FILEPATH ] && echo "Private key $PRIVKEY_FILEPATH exists." || { echo "Private key $PRIVKEY_FILEPATH does not exist." && exit 1 ;}
WORKING_DIR=/tmp/achernar
$cmd mkdir -p $WORKING_DIR
$cmd git clone [email protected]:achernar-iconik/laptop-config.git $WORKING_DIR
$cmd mv $WORKING_DIR/config ~/.ssh/
$cmd mv $WORKING_DIR/.p10k.zsh ~/
$cmd mv $WORKING_DIR/.zshrc ~/
$cmd rm -rf /tmp/achernar