-
Notifications
You must be signed in to change notification settings - Fork 0
/
platformSwitch.sh
executable file
·56 lines (50 loc) · 1.63 KB
/
platformSwitch.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
51
52
53
54
55
56
#!/bin/bash
PLATFORM="UNKNOWN"
for i in "$@"
do
case $i in
-w|--windows)
PLATFORM="WINDOWS"
shift # past argument=value
;;
-l|--linus)
PLATFORM="LINUX"
shift # past argument with no value
;;
-m|--mac)
PLATFORM="MAC"
shift # past argument with no value
;;
*)
# unknown option
;;
esac
done
if [[ ${PLATFORM} == "UNKNOWN" ]]; then
echo "Please give -w, -l or -m to specify the platform (for Windows, Linux or Mac)";
exit 1;
fi
# Remove platform-specific files:
git rm -r Assets/ThirdParty/PlatformSpecific/Windows/ 2> /dev/null
git rm Assets/ThirdParty/PlatformSpecific/Windows.meta 2> /dev/null
git rm -r Assets/ThirdParty/PlatformSpecific/Linux 2> /dev/null
git rm Assets/ThirdParty/PlatformSpecific/Linux.meta 2> /dev/null
git rm -r Assets/ThirdParty/PlatformSpecific/MaxOS 2> /dev/null
git rm Assets/ThirdParty/PlatformSpecific/MaxOS.meta 2> /dev/null
# Copy the platform-specific folders to the Assets directory,
# depending on the OS you're on:
mkdir -p Assets/ThirdParty/PlatformSpecific/
if [[ ${PLATFORM} == "LINUX" ]]; then
echo "Setting up files for: Linux"
echo " Copying Linux libraries to Asset folder."
cp -r PlatformSpecificPlugins/Linux* Assets/ThirdParty/PlatformSpecific/
elif [[ ${PLATFORM} == "MAC" ]]; then
echo "Setting up files for: MacOS"
echo " WARNING: MacOS is currently not supported!"
else
echo "Setting up files for: Windows"
echo " Copying Windows libraries to Asset folder."
cp -r PlatformSpecificPlugins/Windows* Assets/ThirdParty/PlatformSpecific/
fi
git add Assets/ThirdParty/PlatformSpecific/*
git commit -m "Swapped platform specific DLLs to ${PLATFORM}"