-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·82 lines (68 loc) · 2.69 KB
/
deploy
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
75
76
77
78
79
80
81
82
#!/bin/bash
TRIMMED_HOME=$(realpath -s "$HOME")
has() { type -p "$1" >/dev/null; }
# Copy all files starting with . to ~
find . -maxdepth 1 -type f -name ".*" -exec cp -v {} "$TRIMMED_HOME/" \;
# Copy only specified directories
cp -rv "./bin" "$TRIMMED_HOME/"
cp -rv "./.vim" "$TRIMMED_HOME/"
cp -rv "./.config" "$TRIMMED_HOME/"
# Ensure Documents folder (used for cloned code) exists
if [ -d "$TRIMMED_HOME/Documents" ] ; then
mkdir -p "$TRIMMED_HOME/Documents"
fi
# check if neofetch is already cloned
if [ -d "$TRIMMED_HOME/Documents/neofetch" ] ; then
# if it is, pull latest version
git -C "$TRIMMED_HOME/Documents/neofetch" pull
else
# otherwise, clone neofetch from github and place it into ~/Documents/neofetch
git clone "https://github.com/dylanaraps/neofetch.git/" "$TRIMMED_HOME/Documents/neofetch"
fi
# ensure ~/bin/neofetch symlink exists
if [ ! -f "$TRIMMED_HOME/bin/neofetch" ] ; then
ln -sv "$TRIMMED_HOME/Documents/neofetch/neofetch" "$TRIMMED_HOME/bin/neofetch"
fi
# check if ytfzf is already cloned
if [ -d "$TRIMMED_HOME/Documents/ytfzf" ] ; then
# if it is, pull latest version
git -C "$TRIMMED_HOME/Documents/ytfzf" pull
# ensure ~/bin/ytfzf symlink exists
if [ ! -f "$TRIMMED_HOME/bin/ytfzf" ] ; then
ln -sv "$TRIMMED_HOME/Documents/ytfzf/ytfzf" "$TRIMMED_HOME/bin/ytfzf"
fi
fi
# check if zspotify is already cloned
if [ -d "$TRIMMED_HOME/Documents/zspotify" ] ; then
# if it is, pull latest version
git -C "$TRIMMED_HOME/Documents/zspotify" pull
# else
# # otherwise, clone zspotify from github and place it into ~/Documents/zspotify
# git clone "https://github.com/THIS-IS-NOT-A-BACKUP/zspotify" "$TRIMMED_HOME/Documents/zspotify"
fi
#Check if rayshud is already cloned
if has "steam" && [ -d "$TRIMMED_HOME/Documents/rayshud" ] ; then
# if it is, pull latest version
git -C "$TRIMMED_HOME/Documents/rayshud" pull
elif has "steam" ; then
git clone "https://github.com/raysfire/rayshud.git" "$TRIMMED_HOME/Documents/rayshud"
fi
# ensure ~/bin/zspotify alias exists
if [ ! -f "$TRIMMED_HOME/bin/zspotify" ] ; then
echo '#!/bin/bash
python3 "$TRIMMED_HOME/Documents/zspotify/zspotify/__main__.py" "$@"' > "$TRIMMED_HOME/bin/zspotify";
chmod +x "$TRIMMED_HOME/bin/zspotify"
fi
if [ -d "/Applications/Obsidian.app" ] ; then
# ensure ~/bin/obsidian symlink exists
if [ ! -f "$TRIMMED_HOME/bin/obsidian" ] ; then
ln -sv "/Applications/Obsidian.app/Contents/MacOS/Obsidian" "$TRIMMED_HOME/bin/obsidian"
fi
fi
# source new bashrc
# TODO verify this actually works
. "$TRIMMED_HOME/.bashrc"
# nuke bashrc on termux to avoid double sourcing on startup
if [ -n "$TERMUX_VERSION" ] ; then
rm -v "$TRIMMED_HOME/.bashrc"
fi