1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

fix a silly bug introduced in the last commit (#2170)

This commit is contained in:
Roman Perepelitsa 2023-01-23 11:11:20 +01:00
parent f03d917fb0
commit 0adbc1415b

View file

@ -5744,7 +5744,7 @@ function _p9k_prompt_net_iface_async() {
# netstat -inbI en0 # netstat -inbI en0
local iface ip line var local iface ip line var
typeset -a iface2ip ips ifaces typeset -a iface2ip ips ifaces
if (( $+commands[ip] )) && [[ $+commands[ifconfig] == 0 || $OSTYPE != linux* ]]; then if (( $+commands[ip] )) && [[ $+commands[ifconfig] == 0 || $OSTYPE == linux* ]]; then
for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do for line in ${(f)"$(command ip -4 a show 2>/dev/null)"}; do
if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then if [[ $line == (#b)<->:[[:space:]]##([^:]##):[[:space:]]##\<([^\>]#)\>* ]]; then
[[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface= [[ ,$match[2], == *,UP,* ]] && iface=$match[1] || iface=