fix bug that kexec can't get running pod due to preceding for 'wc -l'
This commit is contained in:
parent
6231d9dba4
commit
0f7cc981ce
14
zsh/0001_core.zsh
Normal file
14
zsh/0001_core.zsh
Normal file
@ -0,0 +1,14 @@
|
||||
trim() {
|
||||
local var
|
||||
if (( $# == 0 )) ; then
|
||||
var=$(</dev/stdin)
|
||||
else
|
||||
var="$*"
|
||||
fi
|
||||
|
||||
# remove leading whitespace characters
|
||||
var="${var#"${var%%[![:space:]]*}"}"
|
||||
# remove trailing whitespace characters
|
||||
var="${var%"${var##*[![:space:]]}"}"
|
||||
printf '%s' "$var"
|
||||
}
|
@ -264,4 +264,4 @@ alias yarn_sass="SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ yarn
|
||||
alias vim="nvim"
|
||||
|
||||
## source files
|
||||
alias ss="source ~/.yadr/zsh/functions.zsh; source ~/.yadr/zsh/aliases.zsh"
|
||||
alias ss="source ~/.zshrc"
|
||||
|
@ -39,7 +39,7 @@ function getpod {
|
||||
break
|
||||
fi
|
||||
RUNNING_PODS=($(echo $ALL_PODS | egrep "$PROJECT.* ?[1-9]/[0-9]? *Running" | awk '{print $1}'))
|
||||
if [[ `echo $ALL_PODS | wc -l` != ${#RUNNING_PODS[@]} ]]; then
|
||||
if [[ `echo $ALL_PODS | wc -l | trim` != ${#RUNNING_PODS[@]} ]]; then
|
||||
sleep 2
|
||||
echo $fg[red]'Pods are not ready, wait...'$reset_color
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user