1echo "======================================" 2echo "" 3echo " start add component..." 4echo "" 5echo "======================================" 6 7target_file="./productdefine/common/inherit/rich.json" 8sed -i '/"thirdparty"/{n;d}' ${target_file} 9 10target_line=' "components": [\ 11 {\ 12 "component": "skia",\ 13 "features": []\ 14 },' 15 16key_line='"thirdparty"' 17 18sed -i "/${key_line}/a\ ${target_line}" ${target_file} 19 20echo "======================================" 21echo "" 22echo " modification finished" 23echo "" 24echo "======================================"