Added bootstrap.sh. Files are now copied and not symlinked.

Deleted Makefile
Updated README.
This commit is contained in:
Christian Busch 2016-04-28 08:00:21 +02:00
parent c1bb559045
commit 1b6a5f143b
3 changed files with 111 additions and 37 deletions

View File

@ -1,27 +0,0 @@
EXCLUDE := .DS_Store .git .gitmodules .gitignore
DOTFILES := $(filter-out $(EXCLUDE), $(wildcard .??*))
all: install
help:
@echo "make list #=> Show dot files in this repo"
@echo "make deploy #=> Create symlink to home directory"
@echo "make update #=> Fetch changes for this repo"
@echo "make install #=> Run make update, deploy, init"
list:
@$(foreach val, $(DOTFILES), /bin/ls -dF $(val);)
deploy:
@echo '==> Start to deploy dotfiles to home directory.'
@echo ''
@$(foreach val, $(DOTFILES), ln -sfnv $(abspath $(val)) $(HOME)/$(val);)
update:
git pull origin master
git submodule init
git submodule update
git submodule foreach git pull origin master
install: update deploy
@exec $$SHELL

View File

@ -14,15 +14,17 @@ My color scheme is [Smyck Color Scheme by hukl](https://github.com/hukl/Smyck-Co
The repo ships with a Makefile that you can use to deploy and update the dotfiles. The repo ships with a Makefile that you can use to deploy and update the dotfiles.
# make help # bootstrap.sh help
make list #=> Show dot files in this repo Usage: bootstrap.sh command {params}
make deploy #=> Create symlink to home directory
make update #=> Fetch changes for this repo
make install #=> Run make update, deploy, init
make clean #=> Remove the dot files and this repo
The dotfiles will be symlinked to your **~**. list List all files that will be copied
update Update the git repo and the included submodules
deploy Copy the files to ~
install Update and deploy these dotfiles
help Show this screen
The dotfiles will be copied to your **~**.
## Installation ## Installation
@ -32,15 +34,14 @@ The dotfiles will be symlinked to your **~**.
2. Deploy 2. Deploy
make install ./bootstrap.sh install
3. Enjoy! 3. Enjoy!
If you want to update to the newest version, run ``make update`` from within the dotfiles folder. If you want to update to the newest version, run ``bootstrap.sh update`` from within the dotfiles folder and ``bootstrap.sh deploy`` to copy the updated files.
## Credits ## Credits
- dotfiles based on [dotfiles by hukl](https://github.com/hukl/dotfiles) - dotfiles based on [dotfiles by hukl](https://github.com/hukl/dotfiles)
- Makefile based on [Makefile by b4b4r07](https://github.com/b4b4r07/dotfiles/blob/master/Makefile)
- [Git prompt by Josh Dick](https://gist.github.com/joshdick/4415470) - [Git prompt by Josh Dick](https://gist.github.com/joshdick/4415470)

100
bootstrap.sh Executable file
View File

@ -0,0 +1,100 @@
#!/usr/bin/env sh
# bootstrap.sh
# Copyright 2016 Christian Busch
# http://github.com/chrisb86/dotfiles
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTI
exclude="README.md|init|Makefile|screenshot.png|.git|.gitignore|.gitmodules|.DS_Store|bootstrap.sh"
bootstrap=`basename -- $0`
# Show help screen
# Usage: help exitcode
help () {
echo "Usage: $bootstrap command {params}"
echo
echo "list List all files that will be copied"
echo "update Update the git repo and the included submodules"
echo "deploy Copy the files to ~"
echo "install Update and deploy these dotfiles"
echo "help Show this screen"
exit $1
}
# Update git repo and submodules
# Usage: df_update
df_update () {
git pull origin master
git submodule init
git submodule update
git submodule foreach git pull origin master
}
# Deploy files to ~
# Usage: df_deploy
df_deploy () {
# poor man's rsync
df_list | cpio -pdmB --quiet ~
}
# List files that will be copied
# Usage: df_list
df_list () {
find . -print | grep -vE "$exclude"
}
case "$1" in
######################## bootstrap.sh HELP ########################
help)
help 0
;;
######################## bootstrap.sh LIST ########################
list)
## Lists all files in repo, except those specified in $exclude"
df_list
;;
######################## bootstrap.sh DEPLOY ########################
deploy)
echo "#### Copying files to ~"
# Copy color vim scheme from init folder to .vim/colors
cp init/Smyck-Color-Scheme/smyck.vim .vim/colors/smyck.vim
df_deploy
;;
######################## bootstrap.sh UPDATE ########################
update)
echo "#### Updating git repos and submodules"
df_update
;;
######################## bootstrap.sh INSTALL ########################
install)
echo "#### Updating git repos and submodules"
df_update
echo "#### Copying files to ~"
df_deploy
;;
*)
help 1
;;
esac