Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for the real source path now.

  • Loading branch information...
commit bc60f2a71f4e5472961901c46290bdfedc7aa970 1 parent 9bbf8bb
Techlive Zheng authored
Showing with 14 additions and 8 deletions.
  1. +14 −8 dotploy.sh
22 dotploy.sh
View
@@ -63,8 +63,15 @@ IGNORE=(
# $3 filename of the dotfile
#
docheck() {
- local src=$1/$3
- local dst=$2/$3
+ local src
+ local dst=$1
+ local repath
+
+ repath=${dst#$DESTHOME}
+ repath=${repath#/}
+
+ [ -e $DOTSREPO/$repath ] && src=$DOTSREPO/$repath
+ [ -e $DOTSREPO/__HOST.$HOSTNAME/$repath ] && src=$DOTSREPO/__HOST.$HOSTNAME/$repath
echo "CHECKING: $dst"
@@ -107,6 +114,10 @@ dodeploy() {
local dotdir=$1
local dstdir=$2
+ # host based dotfies deploy
+ [ -e $dotdir/__HOST.$HOSTNAME ] && \
+ dodeploy $dotdir/__HOST.$HOSTNAME $dstdir
+
# recursive identifier
echo -e "--------\n$dotdir\n--------"
@@ -166,7 +177,7 @@ dosymlink() {
# for nested path, need to mkdir parent first
[ -n "$repath" ] && mkdir -vp $DESTHOME/$repath
- docheck $1 $2 $3
+ docheck $dst
local status=$?
@@ -186,9 +197,4 @@ dosymlink() {
ln -v -s $src $dst
}
-# deploy the public dotfiles
dodeploy $DOTSREPO $DESTHOME
-
-# host based dotfies deploy
-[ -e $DOTSREPO/__HOST.$HOSTNAME ] && \
- dodeploy $DOTSREPO/__HOST.$HOSTNAME $HOME
Please sign in to comment.
Something went wrong with that request. Please try again.