-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall
More file actions
executable file
·59 lines (45 loc) · 1.51 KB
/
install
File metadata and controls
executable file
·59 lines (45 loc) · 1.51 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
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# set -x
# REMINDER: if you want to reestablish links to configs on an already installed
# environment, run:
# stow configs --adopt [--simulate -vvv]
set -e
{ #prevent exec until fully downloaded
CWD=$(dirname -- "$(readlink -f -- "$0")")
DIR=~/.dotfiles
HOME=~/
#region get dotfiles
if [ "$CODESPACES" = true ]; then
echo "Running in codespaces..."
DIR="/workspaces/.codespaces/.persistedshare/dotfiles"
fi
if [ ! -d $DIR ]; then
git clone https://github.com/jsg2021/dotfiles.git $DIR
cd $DIR
# git submodule update --init --recursive
fi
source $CWD/scripts/installers/helpers
#endregion
if ! is_git_clean; then
echo "Git repository is not clean. Please commit or stash changes before installing configs."
exit 1
fi
#region tools
if [ "$CODESPACES" = true ]; then
echo "Running in codespaces...skip dev os setup"
return
else
variant=$(uname -s | awk '{print tolower($0)}');
sh $CWD/scripts/installers/$variant;
fi
#endregion
# use adopt to prevent stow from complaining about existing files,
# since we are going to reset hard anyway
stow configs --adopt # -vvv
if ! is_git_clean; then
echo -e "\n\nStashing old .dotfiles that we just replaced... inspect the stash and recover or drop as needed.\n\n";
git stash --include-untracked
fi
sh $CWD/scripts/installers/set-zsh
echo "Installation complete!"
}