mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-26 01:57:26 +08:00
Compare commits
No commits in common. "a04728f1681ca2a185245fb9f6f6eb869c113ad0" and "56297902e9d0f7a14f6d4d88b24eaea7392f3c32" have entirely different histories.
a04728f168
...
56297902e9
@ -32,8 +32,8 @@ fi
|
|||||||
is_plugin() {
|
is_plugin() {
|
||||||
local base_dir=$1
|
local base_dir=$1
|
||||||
local name=$2
|
local name=$2
|
||||||
builtin test -f $base_dir/plugins/$name/$name.plugin.zsh \
|
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|
||||||
|| builtin test -f $base_dir/plugins/$name/_$name
|
|| test -f $base_dir/plugins/$name/_$name
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add all defined plugins to fpath. This must be done
|
# Add all defined plugins to fpath. This must be done
|
||||||
|
|||||||
@ -17,7 +17,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function colored() {
|
function colored() {
|
||||||
command env \
|
env \
|
||||||
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
||||||
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
||||||
LESS_TERMCAP_me=$(printf "\e[0m") \
|
LESS_TERMCAP_me=$(printf "\e[0m") \
|
||||||
|
|||||||
@ -86,11 +86,9 @@ _yarn_scripts() {
|
|||||||
local i runJSON
|
local i runJSON
|
||||||
|
|
||||||
runJSON=$(yarn run --json 2>/dev/null)
|
runJSON=$(yarn run --json 2>/dev/null)
|
||||||
# Some sed utilities (e.g. Mac OS / BSD) don't interpret `\n` in a replacement
|
binaries=($(sed -E '/Commands available/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\n/g' <<< "$runJSON"))
|
||||||
# pattern as a newline. See https://superuser.com/q/307165
|
scriptNames=($(sed -E '/possibleCommands/!d;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\n/g' <<< "$runJSON"))
|
||||||
binaries=($(sed -E '/Commands available/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\'$'\n/g' <<< "$runJSON"))
|
scriptCommands=("${(@f)$(sed -E '/possibleCommands/!d;s/.*"hints":\{([^}]+)\}.*/\1/;s/"[^"]+"://g;s/:/\\:/g;s/","/\n/g;s/(^"|"$)//g' <<< "$runJSON")}")
|
||||||
scriptNames=($(sed -E '/possibleCommands/!d;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\'$'\n/g' <<< "$runJSON"))
|
|
||||||
scriptCommands=("${(@f)$(sed -E '/possibleCommands/!d;s/.*"hints":\{(.+")\}.*/\1/;s/"[^"]+"://g;s/:/\\:/g;s/","/\'$'\n/g;s/(^"|"$)//g' <<< "$runJSON")}")
|
|
||||||
|
|
||||||
for (( i=1; i <= $#scriptNames; i++ )); do
|
for (( i=1; i <= $#scriptNames; i++ )); do
|
||||||
scripts+=("${scriptNames[$i]}:${scriptCommands[$i]}")
|
scripts+=("${scriptNames[$i]}:${scriptCommands[$i]}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user