-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_onchange_after_github-repos.sh.tmpl
43 lines (42 loc) · 1.39 KB
/
run_onchange_after_github-repos.sh.tmpl
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
#!/bin/bash
{{ if eq (len .chezmoi.hostname) 8 }}
# This machine is using the current naming convention! yay!
case ${HOSTNAME:0:1} in
C) formFactor="console";;
D) formFactor="desktop";;
L) formFactor="laptop";;
P) formFactor="phone";;
S) formFactor="server";;
V) formFactor="VM";;
*) formFactor="unknown";;
esac
{{ else }}
# This machine definitely isn't using our naming convention.
formFactor="unknown"
{{ end }}
if [ "$formFactor" = "server" ]; then
# Personal projects
if [ ! -d ~/Projects/halley ]; then
git clone https://github.com/mimuki/halley ~/Projects/halley
fi
if [ ! -d ~/Projects/sw ]; then
git clone https://github.com/mimuki/sw ~/Projects/sw
python3 -m venv ~/Projects/sw/.venv
source ~/Projects/sw/.venv/bin/activate
pip install -U pluralkit
fi
else
# Talon
if [ ! -d ~/.talon/user/rango-talon ]; then
# Chezmoi was too eager and added our config before we cloned
# so we have to do this little dance for the community repo
mv ~/.talon/user/community ~/.talon/user/temp
git clone https://github.com/talonhub/community ~/.talon/user/community
mv -f ~/.talon/user/temp/* ~/.talon/user/community/
rm ~/.talon/user/temp -rf
# rango
git clone https://github.com/david-tejada/rango-talon ~/.talon/user/rango-talon
# cursorless
git clone https://github.com/cursorless-dev/cursorless-talon ~/.talon/user/cursorless-talon
fi
fi