-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·74 lines (57 loc) · 1.91 KB
/
install.sh
File metadata and controls
executable file
·74 lines (57 loc) · 1.91 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# install.sh
#
# Uses GNU stow to create symbolic links between configuration in this repository and the locations they expect to be found by software.
# Enables config to be managed, version-controlled and installed altogether.
# Bash was chosen to allow this to run on a minimal posix system.
set -euo pipefail
####################################
# Ensure GNU stow is installed #
####################################
if ! command -v stow &>/dev/null; then
echo "GNU stow not found. Trying to install it..."
if [[ -f "/etc/debian_version" ]]; then
apt-get update && apt-get install -y stow
elif [[ -f "/etc/alpine-release" ]]; then
apk update && apk --update add stow
elif [[ -f "/etc/centos-release" ]]; then
yum update && yum install -y stow
elif [[ -f "/etc/fedora-release" ]]; then
dnf check-update && dnf install -y stow
else
echo "No installation instruction found."
exit 1
fi
fi
#################
# $HOME #
#################
HOME_DIRECTORY_CONFIG=("tmux" "zsh" "git" "bash")
for config in ${HOME_DIRECTORY_CONFIG[*]}; do
stow --adopt --target="${HOME}" "${config}"
done
#################
# $HOME/bin #
#################
stow --adopt --target="${HOME}/bin" "bin"
################
# .config #
################
CONFIG_DIRECTORY_CONFIG=("fish" "nvim" "starship")
for config in ${CONFIG_DIRECTORY_CONFIG[*]}; do
HOME_CONFIG_DIR="${HOME}/.config/${config}"
mkdir -p "${HOME_CONFIG_DIR}"
stow --adopt --target="${HOME_CONFIG_DIR}" "${config}"
done
#######################
# $HOME/$config/ #
#######################
OWN_CONFIG_DIRECTORY_CONFIG=(".claude")
for config in ${OWN_CONFIG_DIRECTORY_CONFIG[*]}; do
OWN_CONFIG_DIR="${HOME}/${config}"
mkdir -p "${OWN_CONFIG_DIR}"
stow --adopt --target="${OWN_CONFIG_DIR}" "${config}"
done
echo "Dotfiles installed."
echo "Differences:"
git status -s