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