summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2012-12-11 12:32:12 +0100
committerThibaut Horel <thibaut.horel@gmail.com>2012-12-11 12:32:12 +0100
commit7b084703e73ac8c0661e43a817651c86acb015d8 (patch)
tree9b32014c8c36a9041e4d208661c56eea4b62643d /deploy
parent8709b3f607b7e9ba5274a4fbe7c98896a209113d (diff)
downloaddotfiles-7b084703e73ac8c0661e43a817651c86acb015d8.tar.gz
Further refinement of the deploy script, now close to perfection :)
Diffstat (limited to 'deploy')
-rwxr-xr-xdeploy8
1 files changed, 3 insertions, 5 deletions
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