forked from AgoraIO/API-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodify_podfile.py
More file actions
34 lines (30 loc) · 1.55 KB
/
modify_podfile.py
File metadata and controls
34 lines (30 loc) · 1.55 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
import os, sys
def modfiy(path):
with open(path, 'r', encoding='utf-8') as file:
contents = []
for num, line in enumerate(file):
if "pod 'Agora" in line:
line = '\t'+"pod 'sdk', :path => 'sdk.podspec'" + "\n"
elif "pod 'sdk" in line:
line = ""
elif "pod 'Floaty" in line:
line = '\t'+"pod 'Floaty', :git => 'https://gitee.com/shengwang-dependencies/Floaty.git'" + "\n"
elif "pod 'AGEVideoLayout" in line:
line = '\t'+"pod 'AGEVideoLayout', :git => 'https://gitee.com/shengwang-dependencies/AGEVideoLayout.git'" + "\n"
elif "pod 'CocoaAsyncSocket" in line:
line = '\t'+"pod 'CocoaAsyncSocket', :git => 'https://gitee.com/shengwang-dependencies/CocoaAsyncSocket.git'" + "\n"
elif "pod 'SwiftLint" in line:
line = '\t'+"pod 'SwiftLint', :git => 'https://gitee.com/shengwang-dependencies/SwiftLint', :commit => '1067113303c134ef472a71b30d21e5350de7889d'" + "\n"
elif "pod 'ijkplayer" in line:
line = '\t'+"pod 'ijkplayer', :path => 'ijkplayer.podspec'" + "\n"
elif 'sh .download_script' in line:
line = line.replace('#', '').replace('false', 'true')
contents.append(line)
file.close()
with open(path, 'w', encoding='utf-8') as fw:
for content in contents:
fw.write(content)
fw.close()
if __name__ == '__main__':
path = sys.argv[1:][0]
modfiy(path.strip())