-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
142 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
alias stv='synergyc --daemon --restart stvkoch.sl.pt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,139 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
# | ||
# bootstrap installs things. | ||
|
||
unamestr=`uname` | ||
DOTFILES_ROOT="`pwd`" | ||
|
||
if [ "$unamestr" = Linux ]; then | ||
. ~/.dotfiles/script/apt-get | ||
else | ||
. ~/.dotfiles/script/homebrew | ||
fi | ||
set -e | ||
|
||
echo '' | ||
|
||
|
||
# echo "#### Install $ZSH ####" | ||
# # Run the install (I'd like to pull this out of rake, eventually) | ||
# rake install -f ../Rakefile --trace | ||
|
||
info () { | ||
printf " [ \033[00;34m..\033[0m ] $1" | ||
} | ||
|
||
user () { | ||
printf "\r [ \033[0;33m?\033[0m ] $1 " | ||
} | ||
|
||
success () { | ||
printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n" | ||
} | ||
|
||
fail () { | ||
printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n" | ||
echo '' | ||
exit | ||
} | ||
|
||
setup_gitconfig () { | ||
if ! [ -f git/gitconfig.symlink ] | ||
then | ||
info 'setup gitconfig' | ||
|
||
user ' - What is your github author name?' | ||
read -e git_authorname | ||
user ' - What is your github author email?' | ||
read -e git_authoremail | ||
|
||
sed -e "s/AUTHORNAME/$git_authorname/g" -e "s/AUTHOREMAIL/$git_authoremail/g" git/gitconfig.symlink.example > git/gitconfig.symlink | ||
|
||
success 'gitconfig' | ||
fi | ||
} | ||
|
||
link_files () { | ||
ln -s $1 $2 | ||
success "linked $1 to $2" | ||
} | ||
|
||
install_dotfiles () { | ||
info 'installing dotfiles' | ||
|
||
overwrite_all=false | ||
backup_all=false | ||
skip_all=false | ||
|
||
for source in `find $DOTFILES_ROOT -maxdepth 2 -name \*.symlink` | ||
do | ||
dest="$HOME/.`basename \"${source%.*}\"`" | ||
|
||
if [ -f $dest ] || [ -d $dest ] | ||
then | ||
|
||
overwrite=false | ||
backup=false | ||
skip=false | ||
|
||
if [ "$overwrite_all" == "false" ] && [ "$backup_all" == "false" ] && [ "$skip_all" == "false" ] | ||
then | ||
user "File already exists: `basename $source`, what do you want to do? [s]kip, [S]kip all, [o]verwrite, [O]verwrite all, [b]ackup, [B]ackup all?" | ||
read -n 1 action | ||
|
||
case "$action" in | ||
o ) | ||
overwrite=true;; | ||
O ) | ||
overwrite_all=true;; | ||
b ) | ||
backup=true;; | ||
B ) | ||
backup_all=true;; | ||
s ) | ||
skip=true;; | ||
S ) | ||
skip_all=true;; | ||
* ) | ||
;; | ||
esac | ||
fi | ||
|
||
if [ "$overwrite" == "true" ] || [ "$overwrite_all" == "true" ] | ||
then | ||
rm -rf $dest | ||
success "removed $dest" | ||
fi | ||
|
||
if [ "$backup" == "true" ] || [ "$backup_all" == "true" ] | ||
then | ||
mv $dest $dest\.backup | ||
success "moved $dest to $dest.backup" | ||
fi | ||
|
||
if [ "$skip" == "false" ] && [ "$skip_all" == "false" ] | ||
then | ||
link_files $source $dest | ||
else | ||
success "skipped $source" | ||
fi | ||
|
||
else | ||
link_files $source $dest | ||
fi | ||
|
||
done | ||
} | ||
|
||
setup_gitconfig | ||
install_dotfiles | ||
|
||
# If we are on a mac, lets install and setup homebrew | ||
if [ "$(uname -s)" == "Darwin" ] | ||
then | ||
info "installing dependencies" | ||
if . bin/dot > /tmp/dotfiles-dot 2>&1 | ||
then | ||
success "dependencies installed" | ||
else | ||
fail "error installing dependencies" | ||
fi | ||
fi | ||
|
||
echo '' | ||
echo ' All installed!' | ||
|
||
echo "#### Install $ZSH ####" | ||
# Run the install (I'd like to pull this out of rake, eventually) | ||
rake install -f ../Rakefile --trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export EDITOR='subl' | ||
export EDITOR='sublime' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters