/
Build XBMC4Gamers Updater.sh
70 lines (51 loc) · 2.1 KB
/
Build XBMC4Gamers Updater.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
FOLDER_NAME="update-files"
OUTPUT_ZIP="XBMC4Gamers-update-files.zip"
VERSION=$(cat version.txt)
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
magenta=`tput setaf 5`
cyan=`tput setaf 6`
white=`tput setaf 7`
reset=`tput sgr0`
echo "#############################################"
echo "#"
echo "# Welcome to the ${blue}XBMC4Gamers${reset} updater script."
echo "#"
echo "# Shell script by:"
echo "# ${blue}Dominic Hock (Subtixx)${reset}"
echo "#"
echo "# XBMC4Gamers Version:"
echo "# ${blue}$VERSION${reset}"
echo "#"
echo "#############################################"
echo "${green}Building XBMC4Gamers...${reset}"
echo "${green}Copying XBMC4Gamers mod files...${reset}"
cp -a "./Mod Files/." "./update-files/"
cp "./changes.txt" "./update-files/system/SystemInfo/changes.txt"
rm "./update-files/system/UserData/profiles.xml"
echo "${green}Setting variables...${reset}"
if [ ! -e "./update-files/skins/Profile Skin/language/English/strings.po" ]; then
echo "${red}ERROR: Place a fresh copy of XBMC into this folder and try again.${reset}"
rm -r "./XBMC"
exit 1
fi
sed -i "s/0.0.000/$VERSION/g" "./update-files/skins/Profile Skin/language/English/strings.po"
if [ ! -d "./update-files/skins/Manage Profiles Skin" ]; then
mkdir "./update-files/skins/Manage Profiles Skin"
fi
if [ ! -d "./update-files/skins/DVD2Xbox Skin" ]; then
mkdir "./update-files/skins/DVD2Xbox Skin"
fi
cp "./update-files/skins/Profile Skin/language/English/strings.po" "./update-files/skins/Manage Profiles Skin/language/English/strings.po"
cp "./update-files/skins/Profile Skin/language/English/strings.po" "./update-files/skins/DVD2Xbox Skin/language/English/strings.po"
cp "Source/default.xbe" "./update-files/default.xbe"
# Create zip file
echo "${green}Creating zip file...${reset}"
7z a -tzip -mx=7 -r -y "./Other/update build/updater/Update Files/update-files.zip" "*" -mx=7 -r -y
7z a -tzip -mx=7 -r -y "./XBMC4Gamers-update-files.zip" "../Other/update build/*"
rm "./Other/update build/updater/Update Files/update-files.zip"
rm -r "update-files"
echo "${green}Done!${reset}"