123456789101112131415161718192021222324252627282930313233343536 |
- #!/usr/bin/env python
- import os
- def remove_swiftUI(code_file):
- try:
- fo = open(code_file, 'r')
- code_text = fo.read()
- print("替换前:", code_text)
- if "canImport(SwiftUI) && canImport(Combine)" in code_text and "canImport(SwiftUI) && canImport(Combine) && (" \
- "arch(arm64) || arch(x86_64))" not in code_text:
- code_text = code_text.replace("canImport(SwiftUI) && canImport(Combine)", "canImport(SwiftUI) && canImport("
- "Combine) "
- "&& (arch(arm64) || arch(x86_64))")
- print("替换后:", code_text)
- os.remove(code_file)
- fo = open(code_file, 'w+')
- fo.write(code_text)
- fo.closed
- else:
- print("没有变化")
- except IOError:
- print("文件错误")
- else:
- print("没有变化")
- remove_swiftUI("/Users/sanw/Desktop/BytesFlow/Projects/BFCommonKit/Trunk/Example/Pods/Kingfisher/Sources/General"
- "/KFOptionsSetter.swift")
- remove_swiftUI("/Users/sanw/Desktop/BytesFlow/Projects/BFCommonKit/Trunk/Example/Pods/Kingfisher/Sources/SwiftUI"
- "/KFImage.swift")
- remove_swiftUI("/Users/sanw/Desktop/BytesFlow/Projects/BFCommonKit/Trunk/Example/Pods/Kingfisher/Sources/SwiftUI"
- "/ImageBinder.swift")
- remove_swiftUI("/Users/sanw/Desktop/BytesFlow/Projects/BFCommonKit/Trunk/Example/Pods/Kingfisher/Sources/SwiftUI"
- "/KFImageOptions.swift")
- # remove_swiftUI("./Example/Pods/RealmSwift/RealmSwift/SwiftUI.swift")
|