forked from deadc0de6/dotdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdotdrop.sh
More file actions
executable file
·31 lines (26 loc) · 777 Bytes
/
dotdrop.sh
File metadata and controls
executable file
·31 lines (26 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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)
bin="${cur}/dotdrop/dotdrop.py"
cfg="${cur}/config.yaml"
# pivot
cd "${cur}" || { echo "Folder \"${cur}\" doesn't exist, aborting." && exit; }
# init the submodule
git submodule update --init --recursive
# launch dotdrop
python3 "${bin}" --cfg="${cfg}" "${args[@]}"
# pivot back
cd "${opwd}" || { echo "Folder \"${opwd}\" doesn't exist, aborting." && exit; }