mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
wip
This commit is contained in:
parent
c30ed0b1d3
commit
207465dd36
@ -125,15 +125,11 @@ nvm_json_awk_egrep() {
|
||||
|
||||
nvm_json_tokenize() {
|
||||
local GREP
|
||||
GREP='grep -Eao'
|
||||
|
||||
local ESCAPE
|
||||
local CHAR
|
||||
|
||||
if echo 'test string' | grep -Eao --color=never 'test' > /dev/null 2>&1; then
|
||||
GREP='grep -Eao --color=never'
|
||||
else
|
||||
GREP='grep -Eao'
|
||||
fi
|
||||
|
||||
if echo "test string" | grep -Eo "test" > /dev/null 2>&1; then
|
||||
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
|
||||
CHAR='[^[:cntrl:]"\\]'
|
||||
@ -152,7 +148,7 @@ nvm_json_tokenize() {
|
||||
local SPACE
|
||||
SPACE='[[:space:]]+'
|
||||
|
||||
$GREP "${STRING}|${NUMBER}|${KEYWORD}|${SPACE}|." | grep -Ev "^${SPACE}$"
|
||||
$GREP "${STRING}|${NUMBER}|${KEYWORD}|${SPACE}|." | TERM=dumb grep -Ev "^${SPACE}$"
|
||||
}
|
||||
|
||||
_json_parse_array() {
|
||||
|
Loading…
Reference in New Issue
Block a user