-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
35 lines (31 loc) · 969 Bytes
/
install.sh
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
#!/usr/bin/env bash
# System detection
if [ -f /Cygwin.bat ]; then
SYSTEM=Cygwin
fi
# Make sure necessary directories exist
if [ ! -d /usr/local/bin ]; then
mkdir -p /usr/local/bin
fi
# Link files
if [ -w "$HOME" ]; then
for i in .config .gnupg .local .vim .xinitrc; do
ln -s $(pwd)/$i "$HOME"/$i
done
fi
if [ -w /etc/skel ]; then
for i in .config .gnupg .local .vim .xinitrc; do
ln -s $(pwd)/$i /etc/skel/$i
done
fi
if [ "$SYSTEM" = "Cygwin" ]; then
PRG_FLS="/cygdrive/c/Program Files"
PRG_FLS_X86="/cygdrive/c/Program Files (x86)"
ln -s /cygdrive/c/Windows/notepad /usr/local/bin/notepad
for i in $(find "$PRG_FLS/VcXsrv" -maxdepth 1 -type f -executable -name \*.exe ! -name \*uninstall\*); do
ln -s "$i" "/usr/local/bin/$(basename "$i" | sed 's/[.]exe$//')"
done
for i in $(find "$PRG_FLS/qemu" -maxdepth 1 -type f -executable -name qemu-\* ! -name \*uninstall\*); do
ln -s "$i" "/usr/local/bin/$(basename "$i" | sed 's/[.]exe$//')"
done
fi