I use Xcode. I want to use bash to batch modify the UI fonts.
Here is the code to ".xib" and ".storyboard":
xibd(){
cd "$(dirname "$1")/.." && pwd
find . -type f -name "*.xib" -exec sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +
find . -type f -name "*.storyboard" -exec sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +
}
I want to combine -name ".storyboard" and -name ".xib", how to achieve it?
I tried
find . -type f -name '*.storyboard' -o -name "*.xib" -exec sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +
find . -type f -name "*.xib|storyboard" -exec sed -i '' s/'\<fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"\/\>'/'\<fontDescription key=\"fontDescription\" name=\"PingFangSC-Regular\" family=\"PingFang SC\" pointSize=\"12\"\/\>'/ {} +
it does not work.
I have read the related of man find. Still working on it.