Updated dotstow.sh

This commit is contained in:
madmaurice 2015-10-08 17:42:26 +02:00
parent 22a99fd66c
commit f616c7c691

View file

@ -1,5 +1,21 @@
#!/bin/bash
if [ -z "$(which realpath)" ]; then
realpath() {
path=$1
if [ "${path[0]}" == "/" ]; then
echo $path;
elif [ "${path[0]}" == "~" ]; then
echo $HOME/${path:2}
elif [ "${path:0:2}" == ".." ]; then
echo $(dirname $(pwd))/${path:3}
else
echo $(pwd)/$path
fi
}
fi
stow() {
local stowrepo=$1
local stowtarget=$2