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
28 lines (23 loc) · 881 Bytes
/
modify_podfile.py
File metadata and controls
28 lines (23 loc) · 881 Bytes
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
import os, sys
def modfiy(path, sdk_flag):
with open(path, 'r', encoding='utf-8') as file:
contents = []
for num, line in enumerate(file):
if "pod 'Agora" in line:
if sdk_flag:
line = '\t'+"pod 'sdk', :path => '../../sdk.podspec'" + "\n"
elif "pod 'sdk" in line:
if sdk_flag:
line = ""
elif 'sh .download_script' in line:
line = line.replace('true', 'false') + "\n"
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]
sdk_url_is_not_empty = sys.argv[2].lower() == 'true'
modfiy(path.strip(), sdk_url_is_not_empty)