【发布时间】:2021-09-17 17:01:14
【问题描述】:
我是 sed 新手,我有一个包含以下内容的文件
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Sample' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Sample
pod 'FirebaseCore', '7.8.0'
pod 'GoogleUtilities', '7.2.2'
pod 'FirebaseMessaging', '7.8.0'
pod 'FirebaseCrashlytics', '7.8.0'
pod 'FirebaseAnalytics', '7.8.0'
pod 'FirebasePerformance', '7.8.0'
pod 'Fluper', '2.0.0.1'
pod 'lottie-ios', '2.5.0
pod 'XYZ', :git => 'git@bitbucket.org:myteam/xyz.git', :commit => 'a32d154'
pod 'ABC', :git => 'git@bitbucket.org:mytmteam/abc.git', :branch => 'debug101'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
if config.name.include?("Release") || config.name.include?("Adhoc")
config.build_settings['LLVM_LTO'] = 'YES_THIN'
elsif config.name.include?("Debug")
config.build_settings['LLVM_LTO'] = 'NO'
end
end
end
end
我要加, :binary => true
在以 pod 开头并匹配条件 pod 'anyWord', 'Any Number' & pod 'anyWord', :git => 'Anyword', :branch => 'anyWord' 的所有行的末尾
总结一下输出应该是
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'Sample' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Sample
pod 'FirebaseCore', '7.8.0', :binary => true
pod 'GoogleUtilities', '7.2.2', :binary => true
pod 'FirebaseMessaging', '7.8.0', :binary => true
pod 'FirebaseCrashlytics', '7.8.0', :binary => true
pod 'FirebaseAnalytics', '7.8.0', :binary => true
pod 'FirebasePerformance', '7.8.0', :binary => true
pod 'Fluper', '2.0.0.1', :binary => true
pod 'lottie-ios', '2.5.0, :binary => true
pod 'XYZ', :git => 'git@bitbucket.org:myteam/xyz.git', :commit => 'a32d154', :binary => true
pod 'ABC', :git => 'git@bitbucket.org:mytmteam/abc.git', :branch => 'debug101', :binary => true
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
if config.name.include?("Release") || config.name.include?("Adhoc")
config.build_settings['LLVM_LTO'] = 'YES_THIN'
elsif config.name.include?("Debug")
config.build_settings['LLVM_LTO'] = 'NO'
end
end
end
end
请帮助我在 Mac 终端上使用 sed 我最初尝试了以下正则表达式 pod '[a-zA-Z_-]*', '[0-9].*'
【问题讨论】: