-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunScript.txt
More file actions
66 lines (53 loc) · 2.46 KB
/
RunScript.txt
File metadata and controls
66 lines (53 loc) · 2.46 KB
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
##################################################
# Setup variables for folders and plist entries #
# Generally you should only need to change the #
# baseFolder variable #
##################################################
baseFolder="Storm Demo Project";
bundleFolder="Bundle";
appId=$(/usr/libexec/PlistBuddy -c "Print TSCAppId" "$INFOPLIST_FILE");
baseUrl=$(/usr/libexec/PlistBuddy -c "Print TSCBaseURL" "$INFOPLIST_FILE");
apiVersion=$(/usr/libexec/PlistBuddy -c "Print TSCAPIVersion" "$INFOPLIST_FILE");
######################################################
# MANUAL OVERRIDE #
# If you wish to pull a custom bundle define so here #
######################################################
overrideEnabled=FALSE
overrideUrl="https://s3.amazonaws.com/arc.cubeapis.com/bundles/1/test/1369324617_1385400529.tar.gz";
###########################
# Download latest files #
###########################
mkdir -p "$baseFolder/$appId";
if [ -d "$baseFolder/$appId" ]; then
cd "$baseFolder/$appId"; for i in *; do rm -rf "$i"; done;
fi
cd "../../";
if $overrideEnabled ; then
curl $overrideUrl -o "bundle.tar.gz" -v
else
curl $baseUrl/$apiVersion/apps/$appId/bundle?environment=live -vLo "bundle.tar.gz"
fi
if [ -e "bundle.tar.gz" ]; then
tar -zxf "bundle.tar.gz" -C "$baseFolder/$appId"
rm "bundle.tar.gz"
############################################################################################
# Setup Bundle directory. #
# Ensure this folder is included as a refrenced folder in your project once it is created #
############################################################################################
mkdir -p "$baseFolder/$bundleFolder";
if [ -d "$baseFolder/$bundleFolder" ]; then
cd "$baseFolder/$bundleFolder"; for i in *; do rm -rf "$i"; done;
fi
#######################################################################
# Copy downloaded files from numbered app folder into bundle folder #
#######################################################################
cd "../../"
if [ -d "$baseFolder/$appId" ]; then
cd "$baseFolder/$appId"; for i in *; do cp -R "$i" "../$bundleFolder/$i"; done;
fi
######################################
# Move bundle files to XCAssets file #
######################################
cd "../../Thunder Cloud/ThunderCloud"
./AppThinner -i "$PROJECT_DIR/$baseFolder/$bundleFolder/content" -o "$PROJECT_DIR/$baseFolder/Bundle.xcassets"
fi