summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgodot.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/godot.sh b/godot.sh
index c935442..c335da0 100755
--- a/godot.sh
+++ b/godot.sh
@@ -15,8 +15,8 @@ fi
pushd $HOME >/dev/null
# create new symlinks as specified in dotfiles mapping file:
-grep -v "^#\|^$" "${TARGET}/symlink-mapping" | \
- grep "[^ ]\+ -> [^ ]\+" | \
+grep -ve "^#" -e "^$" "${TARGET}/symlink-mapping" | \
+ grep -E "[^ ]+ -> [^ ]+" | \
awk -F " -> " '{ print $1 ; print "'$TARGET'/"$2; }' | \
while read target ; read source ; do
if [[ -e "${target}" && ! -f "${target}" && ! -L "${target}" ]]; then
@@ -36,7 +36,13 @@ popd >/dev/null
pushd "${HOME}/${TARGET}" >/dev/null
# update hash of current symlink mapping
-md5sum "symlink-mapping" > "./management/symlinks.md5"
+if hash md5sum 2> /dev/null ; then
+ md5sum "symlink-mapping" > "./management/symlinks.md5"
+else
+ if hash md5 2> /dev/null ; then
+ md5 "symlink-mapping" > "./management/symlinks.md5"
+ fi
+fi
popd >/dev/null