From 7b084703e73ac8c0661e43a817651c86acb015d8 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Tue, 11 Dec 2012 12:32:12 +0100 Subject: Further refinement of the deploy script, now close to perfection :) --- deploy | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'deploy') diff --git a/deploy b/deploy index f6dc539..1a53e6c 100755 --- a/deploy +++ b/deploy @@ -1,12 +1,10 @@ #! /bin/sh DEPLOY_DIR=$HOME/ #don't forget the trailing slash -OIFS="$IFS" -IFS=$'\n' -cd $(dirname $0) +cd ${0%/*} find -type d ! \( -type d -path "*.git" -prune \) -print0 | xargs -0 -I '{}' mkdir -p $DEPLOY_DIR{} -for file in $(find ! \( -type d -path "*.git" -prune \) -type f ! -path "./deploy" ! -path "./README") +find ! \( -type d -path "*.git" -prune \) -type f ! -path "./deploy" ! -path "./README" -print0 | while IFS="" read -r -d "" file do - ln -snf $PWD/$file $DEPLOY_DIR$(dirname $file) + ln -snf $PWD/$file $DEPLOY_DIR${file%/*} done -- cgit v1.2.3-70-g09d2