问题描述
我想使用bash脚本/命令在Info.plist
文件中添加/替换URL方案.
I want to add/replace the URL scheme in Info.plist
file using bash script/command.
我尝试了使用sed
命令的各种模式,但没有成功.
I tried with sed
command with various patterns but not succeeded.
我们想使用Jenkins自动生成版本,并且可以针对各种版本更改我们的URL方案,因此我们想要修改Info.plist
文件,以便我们可以在不存在的情况下添加新的URL方案或替换现有的URL方案.一个使用脚本/命令.
We want to automate the build generation using Jenkins and our URL Scheme can be changed for various builds, so we want to modify the Info.plist
file such that we can either add a new URL Scheme if not there or replace the existing one using script/commands.
请建议使用该命令来实现.
Please suggest the command to achieve this.
推荐答案
我们可以使用awk命令而不是sed轻松实现复杂的事情.
We can use awk command to achieve complex things easily instead of sed.
我可以通过"Ed Morton"的帮助完成任务,如
I am able to accomplish the task by the help of "Ed Morton" as in sed : Insert lines after specific pattern with newline
这篇关于使用bash脚本在Info.plist中添加/替换URL方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!