-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
51 lines (51 loc) · 2.57 KB
/
setup.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
#! /bin/bash
read -p " <<<<<< Enter Your Project Name: " projectName
read -p " <<<<<< Enter Your Project BundleId: " bundleId
read -p " <<<<<< Enter Your Project iOS Deployment Target (default is 9.0, minimum is 9.0): " deoployTarget
read -p " <<<<<< Enter Your Project Development Region (fa/en, default is fa): " devRegion
mv starter $projectName
echo " >>>>>> Initializing project... , please wait"
mv $projectName/starter $projectName/$projectName
mv $projectName/starter.xcodeproj $projectName/$projectName.xcodeproj
mv $projectName/starter.xcworkspace $projectName/$projectName.xcworkspace
cd $projectName
cd $projectName.xcworkspace
find . -exec sed -i '' -e "s/starter/$projectName/g" {} \;
cd ../
cd $projectName.xcodeproj
find . -exec sed -i '' -e "s/starter/$projectName/g" {} \;
find . -name 'project.pbxproj' -print0 | xargs -0 sed -i "" "s/9.0/$deoployTarget/g"
find . -name 'project.pbxproj' -print0 | xargs -0 sed -i "" "s/developmentRegion = fa;/developmentRegion = $devRegion;/g"
mv xcuserdata/starter.xcuserdatad xcuserdata/$(id -un).xcuserdatad
cd ../
cd Common/Common.xcodeproj
find . -exec sed -i '' -e "s/starter/$projectName/g" {} \;
find . -name 'project.pbxproj' -print0 | xargs -0 sed -i "" "s/9.0/$deoployTarget/g"
find . -name 'project.pbxproj' -print0 | xargs -0 sed -i "" "s/developmentRegion = fa;/developmentRegion = $devRegion;/g"
cd ../../
find . -name 'Podfile' -print0 | xargs -0 sed -i "" "s/starter/$projectName/g"
cd $projectName
cd 'app'
find . -name 'Production.xcconfig' -print0 | xargs -0 sed -i "" "s/Starter/$projectName/g"
find . -name 'Staging.xcconfig' -print0 | xargs -0 sed -i "" "s/Starter/$projectName/g"
find . -name 'Development.xcconfig' -print0 | xargs -0 sed -i "" "s/Starter/$projectName/g"
find . -name 'Production.xcconfig' -print0 | xargs -0 sed -i "" "s/ir.rainyday.ios.starter/$bundleId/g"
find . -name 'Staging.xcconfig' -print0 | xargs -0 sed -i "" "s/ir.rainyday.ios.starter/$bundleId/g"
find . -name 'Development.xcconfig' -print0 | xargs -0 sed -i "" "s/ir.rainyday.ios.starter/$bundleId/g"
echo " >>>>>> Project initialized"
cd ../../../
mkdir -p ~/Library/Developer/Xcode/Templates/File\ Templates
cp -r MTP\ Templates ~/Library/Developer/Xcode/Templates/File\ Templates
echo " >>>>>> 'MTP Templates' moved to Xcode templates"
rm -R MTP\ Templates
rm -R screenshots
rm -R README.md
echo " >>>>>> extra files removed"
cd $projectName
echo " >>>>>> Installing dependencies... , please wait"
pod install
echo " >>>>>> Dependencies installed"
echo " >>>>>> Openning project... , please wait"
open "$projectName.xcworkspace"
cd ../
rm -- "$0"