-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·47 lines (38 loc) · 1.22 KB
/
install.sh
File metadata and controls
executable file
·47 lines (38 loc) · 1.22 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
#!/usr/bin/env bash
# bootstrap the configuration
# requires git
# backup configs
for dotfile in ~/.{bash_profile,bashrc,freshrc,gitconfig,tmux.conf}; do
[ -r "$dotfile" ] && mv -vf $dotfile ~/.dotfiles/backups/
done
unset dotfile
# copy .freshrc to ~
cp -vf ~/.dotfiles/.freshrc ~
# copy bin/symlinks to ~/bin
if [[ "$(uname)" == "Darwin" ]]; then
cp -R ~/.dotfiles/bin/symlinks/* ~/bin/
fi
if [ -e ~/.dotfiles/.gituserconfig ]; then
echo "Git user config already exists."
else
touch ~/.dotfiles/.gituserconfig
echo "### user specific settings" >> ~/.dotfiles/.gituserconfig
echo "### e.g." >> ~/.dotfiles/.gituserconfig
echo "# [user]" >> ~/.dotfiles/.gituserconfig
echo "# name = John Doe" >> ~/.dotfiles/.gituserconfig
echo "# email = jdoe@example.com" >> ~/.dotfiles/.gituserconfig
echo "Git user config intialized. Please edit and re-run \`fresh\`."
fi
# install fresh or run for re-fresh
if [[ -z `which fresh` ]]; then
bash -c "`curl -sL get.freshshell.com`"
else
fresh
fi
# source it
if [[ -z "$SIM_DOTFILES_SETUP" ]]; then
[ -r "~/.bash_profile" ] && source ~/.bash_profile
fi
if [[ -n "$SIM_DOTFILES_SETUP" ]]; then
echo "All done! Your prompt should be updated and you are now using Fresh."
fi