fix bug
This commit is contained in:
parent
b7e24949b3
commit
b887abc50a
@ -7,6 +7,11 @@ function modify_json_file() {
|
|||||||
local key=$2 # 要修改的key
|
local key=$2 # 要修改的key
|
||||||
local value=$3 # 要修改的value
|
local value=$3 # 要修改的value
|
||||||
|
|
||||||
|
#如果key的值是.开头, 则去掉.号
|
||||||
|
if [[ ${key} == "."* ]]; then
|
||||||
|
key=${key:1}
|
||||||
|
fi
|
||||||
|
|
||||||
jq ".${key} = \"${value}\"" ${json_file} > ${json_file}.tmp
|
jq ".${key} = \"${value}\"" ${json_file} > ${json_file}.tmp
|
||||||
mv ${json_file}.tmp ${json_file}
|
mv ${json_file}.tmp ${json_file}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user