updated dotstow
This commit is contained in:
parent
af460623b8
commit
7396d45807
1 changed files with 10 additions and 10 deletions
20
dotstow.sh
20
dotstow.sh
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
if [ -z "$(which realpath)" ]; then
|
if [ -z "$(which realpath)" ]; then
|
||||||
realpath() {
|
realpath() {
|
||||||
path=$1
|
rpath=$1
|
||||||
if [ "${path[0]}" == "/" ]; then
|
if [ "${rpath[0]}" == "/" ]; then
|
||||||
echo $path;
|
echo $rpath;
|
||||||
elif [ "${path[0]}" == "~" ]; then
|
elif [ "${rpath:0:1}" == "~" ]; then
|
||||||
echo $HOME/${path:2}
|
echo $HOME/${rpath:2}
|
||||||
elif [ "${path:0:2}" == ".." ]; then
|
elif [ "${rpath:0:2}" == ".." ]; then
|
||||||
echo $(dirname $(pwd))/${path:3}
|
echo $(dirname $(pwd))/${rpath:3}
|
||||||
elif [ "${path[0]}" == "." ]; then
|
elif [ "${rpath:0:1}" == "." ]; then
|
||||||
echo $(pwd)/${path:2}
|
echo $(pwd)/${rpath:2}
|
||||||
else
|
else
|
||||||
echo $(pwd)/$path
|
echo $(pwd)/$rpath
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue