-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·74 lines (64 loc) · 1.71 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·74 lines (64 loc) · 1.71 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
targets=${@//home/}
targets="home $targets"
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null
echo "dotSetting at: $(pwd)"
echo ""
echo "Installing symlinks via stow:"
echo " stow -v -t ~ --no-folding $targets"
echo ""
echo "About stow: https://www.gnu.org/software/stow/"
echo "BTW, if there are existing files not stowed, please delete manually"
read -p "(Press Y to continue) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
stow -v -t ~ --no-folding $targets
echo "stow done"
else
echo "exiting..."
exit
fi
BASHRC_SOURCE='source "$HOME/.config/shrc/bashrc"'
if ! grep -q "$BASHRC_SOURCE" "$HOME/.bashrc"; then
echo ""
echo "Injecting .bashrc:"
echo " echo \"$BASHRC_SOURCE\" >> \"\$HOME/.bashrc\""
echo ""
read -p "(Press Y to continue) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "$BASHRC_SOURCE" >> "$HOME/.bashrc"
echo ".bashrc injected"
else
echo ".bashrc skipped"
fi
fi
if ! grep -q "$BASHRC_SOURCE" "$HOME/.bash_profile"; then
echo ""
echo "Injecting .bash_profile:"
echo " echo \"$BASHRC_SOURCE\" >> \"\$HOME/.bash_profile\""
echo ""
read -p "(Press Y to continue) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "$BASHRC_SOURCE" >> "$HOME/.bash_profile"
echo ".bash_profile injected"
else
echo ".bash_profile skipped"
fi
fi
ZSHRC_SOURCE='source "$HOME/.config/shrc/zshrc"'
if ! grep -q "$ZSHRC_SOURCE" "$HOME/.zshrc"; then
echo ""
echo "Injecting .zshrc:"
echo " echo \"$ZSHRC_SOURCE\" >> \"\$HOME/.zshrc\""
echo ""
read -p "(Press Y to continue) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "$ZSHRC_SOURCE" >> "$HOME/.zshrc"
echo ".zshrc injected"
else
echo ".zshrc skipped"
fi
fi