forked from rkalis/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·48 lines (36 loc) · 1.53 KB
/
install
File metadata and controls
executable file
·48 lines (36 loc) · 1.53 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
set -e
DEFAULT_CONFIG_PREFIX="default"
CONFIG_SUFFIX=".conf.yaml"
DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${BASEDIR}"
echo "Current directory: ${BASEDIR}"
echo "PATH: $PATH"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive "${DOTBOT_DIR}"
git -C dotbot-vscode submodule sync --quiet --recursive
git submodule update --init --recursive dotbot-vscode
if [[ "${@}" == *"mac"* ]]; then
git -C dotbot-brew submodule sync --quiet --recursive
git submodule update --init --recursive dotbot-brew
fi
if [[ "${@}" == *"endeavour"* ]]; then
git -C dotbot-yay submodule sync --quiet --recursive
git submodule update --init --recursive dotbot-yay
fi
# Check if code (Visual Studio Code) is installed
if ! command -v code &> /dev/null; then
echo "Visual Studio Code (code) is not installed."
fi
for conf in ${DEFAULT_CONFIG_PREFIX} ${@}; do
if [[ "${@}" == *"mac"* ]]; then
echo "Running dotbot with dotbot-brew plugin"
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" --plugin-dir dotbot-vscode --plugin-dir dotbot-brew -c "${conf}${CONFIG_SUFFIX}" -v
elif [[ "${@}" == *"endeavour"* ]]; then
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" --plugin-dir dotbot-vscode -p dotbot-yay/yay.py -c "${conf}${CONFIG_SUFFIX}" -v
else
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" --plugin-dir dotbot-vscode -c "${conf}${CONFIG_SUFFIX}" -v
fi
done