-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbootstrap.linux.sh
More file actions
executable file
·37 lines (30 loc) · 957 Bytes
/
bootstrap.linux.sh
File metadata and controls
executable file
·37 lines (30 loc) · 957 Bytes
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
#!/bin/bash
set -eo pipefail
CURRDIR=`pwd`
SCRIPTDIR=$(cd `dirname $0` && pwd)
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# create links
mkdir -p ~/.config
cd ~/.config
[[ ! -L foot ]] && ln -s ${SCRIPTDIR}/config/foot foot
echo
echo "installing fonts"
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
for f in $(ls ${SCRIPTDIR}/fonts); do
[[ ! -L $f ]] && ln -s ${SCRIPTDIR}/fonts/$f
done
# distro-specific boostrap
echo
if [[ -f ${SCRIPTDIR}/bootstrap.${LINUX_DISTRO}.sh ]]; then
echo "bootstrapping ${LINUX_DISTRO}"
${SCRIPTDIR}/bootstrap.${LINUX_DISTRO}.sh
else
echo "don't know how to bootstrap ${LINUX_DISTRO}: no bootstrap.${LINUX_DISTRO}.sh" >&2
exit 1
fi
cd ${CURRDIR}