-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
69 lines (58 loc) · 2.38 KB
/
start.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# TODO: test with this once you buy better pc that can run virtual machine or find other way to test.
# https://youtu.be/4ygaA_y1wvQ?t=924
# set -euo pipefail
dependency_packages=(
bash
snap
gnome-shell
wget
stow
git
)
all_dependency_packages_are_installed=true
for dep_pkg in "${dependency_packages[@]}"; do
if [ -z "$(which "$dep_pkg")" ]; then
all_dependency_packages_are_installed=false
break
fi
done
if $all_dependency_packages_are_installed; then
echo "<--- All dependency packages are installed. --->"
echo "<--- Starting installation... --->"
# HACK: I need to repeat stow twice. First so that if files exist already, those files overwrite
# this git repo's files, then I reset this repo and run stow again.
# all this because git stow can't overwrite files / directories if they are already present.
# prompt to decide cloning method - https or ssh - ssh is default behavior
read -r -p "Do you want to use ssh for cloning? (Y/n)" prompt_response
if [[ $prompt_response == "n" ]]; then
echo "<--- cloning using HTTPS... --->"
git clone --recurse-submodules https://github.com/monoira/.dotfiles.git ~/.dotfiles &&
bash ~/.dotfiles/install_scripts/_install.sh &&
cd ~/.dotfiles &&
stow --verbose --adopt alacritty cmus git nvim sqlfluff tmux zsh &&
git add . && git reset --hard &&
stow --verbose --adopt alacritty cmus git nvim sqlfluff tmux zsh
else
echo "<--- cloning using SSH... --->"
git clone --recurse-submodules [email protected]:monoira/.dotfiles.git ~/.dotfiles &&
bash ~/.dotfiles/install_scripts/_install.sh &&
cd ~/.dotfiles &&
stow --verbose --adopt alacritty cmus git nvim sqlfluff tmux zsh &&
git add . && git reset --hard &&
stow --verbose --adopt alacritty cmus git nvim sqlfluff tmux zsh
fi
else
echo "<--- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --->"
echo "<--- ONE OR MORE OF THE REQUIRED DEPENDENCY PACKAGES ARE NOT INSTALLED!!! --->"
echo "<--- The dependency packages are: --->"
# checks each package individually to see which packages
# are not installed and echos them out if they are not installed
for dep_pkg in "${dependency_packages[@]}"; do
if [ "$(which "$dep_pkg")" ]; then
echo "<--- $dep_pkg - Status: Installed. --->"
else
echo "<--- $dep_pkg - Status: NOT INSTALLED!!! --->"
fi
done
fi