dotfiles

configuration files for different softwares
git clone git://z3bra.org/dotfiles
Log | Files | Refs

commit d1aedfb0a972b1b30cbc7819528c60d85f3a9329
parent e2ebc2d640318e8637e583c96e0c78ec233318de
Author: z3bra <willy@mailoo.org>
Date:   Mon Mar 30 22:48:59 2015

changed deploy script name

Diffstat:
 copy.sh | 70 +------------------------------------------------------------------
 deploy  | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/copy.sh b/copy.sh @@ -1,70 +0,0 @@ -#!/bin/sh - -TMPFILE=/tmp/dotfiles.list - -R=`tput setaf 1` -G=`tput setaf 2` -B=`tput setaf 6` -N=`tput sgr0` -b=`tput bold` - -OK="[${G} OK ${N}]" -NOPE="[${R}FAIL${N}]" - -listfiles() { - cat <<EOF > $TMPFILE -## -## Here is an auto-generated file for linking -## config file to your $home directory -## -## The $0 script will read filenames from that -## file in order to create ONLY the links you -## want. -## -## The following list lists every. single. file -## or directory. Just remove the line that you -## don't want to be linked. -## Then, save that file, and watch the magic happen... -## -EOF - - echo "listing the whole directory" - ls $PWD >> $TMPFILE - - # Remove this script from the file list - sed -i "/`basename $0`/d" $TMPFILE -} - -config() { -# Edit the temporary file -test -z "$EDITOR" && vi $TMPFILE || $EDITOR $TMPFILE -} - -simulate() { -# Print what's going to happen -echo "the following files will be linked:" -for f in `grep -v '^#' $TMPFILE`; do - echo "~/.$f -> ${B}${PWD}/$f${N}" -done -} - -link() { - read -p "hit ^C to abort..." - for f in `grep -v '^#' $TMPFILE`; do - echo -n "${f} ... " - ln -s $PWD/$f ~/.$f 2>/dev/null && echo $OK || echo $NOPE - done -} - -clean() { - echo "removing temporary files" - rm $TMPFILE -} - -test -f $TMPFILE || listfiles -config -simulate -link -clean - -exit 0 diff --git a/deploy b/deploy @@ -0,0 +1,70 @@ +#!/bin/sh + +TMPFILE=/tmp/dotfiles.list + +R=`tput setaf 1` +G=`tput setaf 2` +B=`tput setaf 6` +N=`tput sgr0` +b=`tput bold` + +OK="[${G} OK ${N}]" +NOPE="[${R}FAIL${N}]" + +listfiles() { + cat <<EOF > $TMPFILE +## +## Here is an auto-generated file for linking +## config file to your $home directory +## +## The $0 script will read filenames from that +## file in order to create ONLY the links you +## want. +## +## The following list lists every. single. file +## or directory. Just remove the line that you +## don't want to be linked. +## Then, save that file, and watch the magic happen... +## +EOF + + echo "listing the whole directory" + ls $PWD >> $TMPFILE + + # Remove this script from the file list + sed -i "/`basename $0`/d" $TMPFILE +} + +config() { +# Edit the temporary file +test -z "$EDITOR" && vi $TMPFILE || $EDITOR $TMPFILE +} + +simulate() { +# Print what's going to happen +echo "the following files will be linked:" +for f in `grep -v '^#' $TMPFILE`; do + echo "~/.$f -> ${B}${PWD}/$f${N}" +done +} + +link() { + read -p "hit ^C to abort..." + for f in `grep -v '^#' $TMPFILE`; do + echo -n "${f} ... " + ln -sf $PWD/$f ~/.$f 2>/dev/null && echo $OK || echo $NOPE + done +} + +clean() { + echo "removing temporary files" + rm $TMPFILE +} + +test -f $TMPFILE || listfiles +config +simulate +link +#clean + +exit 0