-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
35 lines (25 loc) · 1.11 KB
/
install.sh
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
#!/usr/bin/env bash
# ##############################################################################
# ## config #
# ##############################################################################
declare -r DOTDIR="${HOME}/.local/share/42dotfiles";
declare -r PULLURL="https://github.com/thibautdbs/42dotfiles.git";
declare -r PUSHURL="[email protected]:thibautdbs/42dotfiles.git";
# ##############################################################################
# ## Main #
# ##############################################################################
my::main()
{
#assert DOTDIR doesn't exist.
if [ -d "${DOTDIR}" ]; then
echo "Error: ${DOTDIR} already exists." >&2;
exit 1;
fi
git clone -o "origin" -b "master" --depth 1 "${PULLURL}" "${DOTDIR}";
git -C "${DOTDIR}" remote set-url "origin" "${PULLURL}";
git -C "${DOTDIR}" remote set-url --push "origin" "${PUSHURL}";
export PATH="${DOTDIR}/bin/:${PATH}";
export PATH="${DOTDIR}/scripts/:${PATH}";
42df config;
}
my::main;