mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
Improve JSON encoding
This commit is contained in:
parent
77036074ef
commit
a3c03d021e
|
|
@ -14,13 +14,17 @@ abort() {
|
|||
#
|
||||
|
||||
json() {
|
||||
local title="${1//\"/\\\"}"
|
||||
local body="${2//\"/\\\"}"
|
||||
local head="${3//\"/\\\"}"
|
||||
local base="${4//\"/\\\"}"
|
||||
cat <<EOF
|
||||
{
|
||||
"title": "$1",
|
||||
"body": "$2",
|
||||
"head": "$3",
|
||||
"base": "$4"
|
||||
}
|
||||
"title": "$title",
|
||||
"body": "$body",
|
||||
"head": "$head",
|
||||
"base": "$base"
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue