forked from eckhart/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit
29 lines (27 loc) · 1.09 KB
/
init
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
#!/bin/bash
#
# Initialize a dotfile repository using the dots manager
#
# 1. Create the $HOME/.local/lib directory
# 2. Clone the dots manager tool into the lib directory
# 3. Kick off the dots/contrib/initialize script to handle the rest of the setup
# of the dotfiles. The DOTS_CLONE_DIR environment will be set for this
#
# This script must be sourced!
[[ $_ == $0 ]] && echo "Please source me!" && exit 1
# Setup the environment for the new dots repository
DOTS_RELEASE="main"
DOTS_CLONE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Do we have go installed
if command -v go; then
source /dev/stdin <<<"$(curl --silent --show-error --location \
https://github.com/evanpurkhiser/dots/raw/main/scripts/bootstrap)"
else
# Clone the dots manager utility
if [[ ! -d "$HOME/.local/lib/dots" ]]; then
echo -e "\033[0;32m==>\033[0m Installing dots managment utility"
git clone -q https://github.com/EvanPurkhiser/dots "$HOME/.local/lib/dots"
fi
git --git-dir "$HOME/.local/lib/dots/.git" --work-tree "$HOME/.local/lib/dots" checkout releases/1.x
source "$HOME/.local/lib/dots/contrib/initialize"
fi