forked from ChaoticOnyx/OnyxBay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsourcedm.sh
executable file
·50 lines (48 loc) · 1.21 KB
/
sourcedm.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
if [[ $(uname) == MINGW* ]]
then
if hash dm.exe 2>/dev/null
then
export DM='dm.exe'
return 0
elif [[ -a '/c/Program Files (x86)/BYOND/bin/dm.exe' ]]
then
export DM='/c/Program Files (x86)/BYOND/bin/dm.exe'
return 0
elif [[ -a '/c/Program Files/BYOND/bin/dm.exe' ]]
then
export DM='/c/Program Files/BYOND/bin/dm.exe'
return 0
fi
elif grep -Fq "Microsoft" /proc/sys/kernel/osrelease # detect WSL
then
if hash dm.exe 2>/dev/null
then
export DM='dm.exe'
return 0
elif [[ -a '/mnt/c/Program Files (x86)/BYOND/bin/dm.exe' ]]
then
export DM='/mnt/c/Program Files (x86)/BYOND/bin/dm.exe'
return 0
elif [[ -a '/mnt/c/Program Files/BYOND/bin/dm.exe' ]]
then
export DM='/mnt/c/Program Files/BYOND/bin/dm.exe'
return 0
fi
else
if hash DreamMaker 2>/dev/null
then
export DM='DreamMaker'
return 0
elif [[ -a '/usr/bin/DreamMaker' ]]
then
export DM='/usr/bin/DreamMaker'
return 0
elif [[ -a '/usr/share/byond/bin/DreamMaker' ]]
then
export DM='/usr/share/byond/bin/DreamMaker'
return 0
fi
fi
export DM=''
return 1