From b6f0f453e3c70076971c3ac9d6c895383cfda155 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sat, 21 Nov 2020 15:36:57 +0200 Subject: [PATCH] Update dotdrop --- dotdrop | 2 +- dotdrop.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 dotdrop.sh diff --git a/dotdrop b/dotdrop index 0ebbdf7..675c820 160000 --- a/dotdrop +++ b/dotdrop @@ -1 +1 @@ -Subproject commit 0ebbdf7a84c557a41e415afbe4e0a41ed8a2f1e5 +Subproject commit 675c8206061269a10ed3e03871be0264fc784ce2 diff --git a/dotdrop.sh b/dotdrop.sh new file mode 100755 index 0000000..8c458a5 --- /dev/null +++ b/dotdrop.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# author: deadc0de6 (https://github.com/deadc0de6) +# Copyright (c) 2017, deadc0de6 + +# check for readlink/realpath presence +# https://github.com/deadc0de6/dotdrop/issues/6 +rl="readlink -f" + +if ! ${rl} "${0}" >/dev/null 2>&1; then + rl="realpath" + + if ! hash ${rl}; then + echo "\"${rl}\" not found!" && exit 1 + fi +fi + +# setup variables +args=("$@") +cur=$(dirname "$(${rl} "${0}")") +opwd=$(pwd) +cfg="${cur}/config.yaml" +sub="dotdrop" + +# pivot +cd "${cur}" || { echo "Directory \"${cur}\" doesn't exist, aborting." && exit 1; } +# init/update the submodule +if [ "${DOTDROP_AUTOUPDATE-yes}" = yes ] ; then + git submodule update --init --recursive + git submodule update --remote dotdrop +fi +# launch dotdrop +PYTHONPATH=dotdrop python3 -m dotdrop.dotdrop "${args[@]}" +ret="$?" +# pivot back +cd "${opwd}" || { echo "Directory \"${opwd}\" doesn't exist, aborting." && exit 1; } +# exit with dotdrop exit code +exit ${ret}