-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·61 lines (50 loc) · 1.71 KB
/
init.sh
File metadata and controls
executable file
·61 lines (50 loc) · 1.71 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
#!/bin/sh
# based on https://github.com/akito19/dotfiles/blob/master/init.sh
set -eu
is_setup() {
echo "Do you setup $1? [y/N]"
while :
do
read -r answer
case $answer in
'yes' | 'y') return 0 ;;
[nN]o | [nN]) return 1 ;;
*) echo "Try again because you input incorrect letter. Do you setup $1? [y/N]" ;;
esac
done
}
if is_setup 'global .gitignore'; then
if [ "$(uname)" = 'Darwin' ]; then
curl -fL 'https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore' >> ~/.gitignore
else
curl -fL 'https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore' >> ~/.gitignore
fi
echo '' >> ~/.gitignore
echo '# VisualStudioCode' >> ~/.gitignore
curl -fL 'https://raw.githubusercontent.com/github/gitignore/master/Global/VisualStudioCode.gitignore' >> ~/.gitignore
echo '' >> ~/.gitignore
echo '# Vim' >> ~/.gitignore
curl -fL 'https://raw.githubusercontent.com/github/gitignore/master/Global/Vim.gitignore' >> ~/.gitignore
fi
if [ "$(uname)" = 'Darwin' ]; then
if is_setup 'Xcode Command Line Tools'; then
xcode-select --install
fi
if is_setup 'Homebrew'; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew doctor
fi
if is_setup 'some tools by Homebrew and Homebrew cask'; then
~/dotfiles/brew.sh
~/dotfiles/cask.sh
fi
fi
if [ ! -d $HOME/dotfiles ]; then
git clone https://github.com/tkmru/dotfiles.git ~/dotfiles
fi
echo 'Change default shell from zsh to bash'
chsh -s /bin/bash
~/dotfiles/bin/setup_mitamae.sh
~/dotfiles/deploy.sh