Updated dotstow.sh
This commit is contained in:
parent
22a99fd66c
commit
f616c7c691
1 changed files with 16 additions and 0 deletions
16
dotstow.sh
16
dotstow.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue