#!/bin/bash # 设置要替换的目标地址 new_target="http://192.168.0.42:9977" # 检查new_target是否以/结尾 if [[ $new_target != */ ]]; then new_target="$new_target/" fi # 替换vue.config.js文件中的target地址 sed -i "s#target: 'https://pwxdev.cleartv.cn/'#target: '$new_target'#g" vue.config.js # 替换index.vue文件中的地址 sed -i "s#https://pwxdev.cleartv.cn/#$new_target#g" src/views/dashboard/index.vue # 执行git update-index --assume-unchanged命令 # git update-index --assume-unchanged vue.config.js src/views/dashboard/index.vue