diff options
author | neodarz <neodarz@neodarz.net> | 2019-09-04 20:49:00 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-09-04 20:49:00 +0200 |
commit | 948d791be2c14409958450f02292cb7cb7e5b0f2 (patch) | |
tree | fb4b9720f92b9d00f1fecd82626bfd82c05e514d | |
download | dotfiles-948d791be2c14409958450f02292cb7cb7e5b0f2.tar.xz dotfiles-948d791be2c14409958450f02292cb7cb7e5b0f2.zip |
Add dotdrop
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | config.yaml | 6 | ||||
m--------- | dotdrop | 0 | ||||
-rwxr-xr-x | dotdrop.sh | 37 |
4 files changed, 46 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..674e4c5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "dotdrop"] + path = dotdrop + url = https://github.com/deadc0de6/dotdrop.git diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..2694881 --- /dev/null +++ b/config.yaml @@ -0,0 +1,6 @@ +config: + backup: true + create: true + dotpath: dotfiles +dotfiles: +profiles: diff --git a/dotdrop b/dotdrop new file mode 160000 +Subproject 40bcd7fd48fa43d0e515f7417975b0e75c829a8 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} |