shfmt lint

pull/1766/head
BarbUk 2021-01-06 12:42:59 +01:00
parent e3b577a6ed
commit 4b6f023389
No known key found for this signature in database
GPG Key ID: DB301C759539E9FE
1 changed files with 46 additions and 46 deletions

View File

@ -41,20 +41,20 @@ SCM_THEME_CURRENT_USER_PREFFIX='  '
SCM_GIT_SHOW_CURRENT_USER=false
function _git-uptream-remote-logo {
[[ "$(_git-upstream)" == "" ]] && SCM_GIT_CHAR="$SCM_GIT_CHAR_DEFAULT"
[[ "$( _git-upstream)" == "" ]] && SCM_GIT_CHAR="$SCM_GIT_CHAR_DEFAULT"
local remote remote_domain
remote=$(_git-upstream-remote)
remote_domain=$(git config --get remote."$remote".url | awk -F'[@:.]' '{print $2}')
remote=$( _git-upstream-remote)
remote_domain=$( git config --get remote."$remote".url | awk -F'[@:.]' '{print $2}')
# remove // suffix for https:// url
remote_domain=${remote_domain//\//}
case $remote_domain in
github ) SCM_GIT_CHAR="$SCM_GIT_CHAR_GITHUB";;
gitlab ) SCM_GIT_CHAR="$SCM_GIT_CHAR_GITLAB";;
bitbucket ) SCM_GIT_CHAR="$SCM_GIT_CHAR_BITBUCKET";;
* ) SCM_GIT_CHAR="$SCM_GIT_CHAR_DEFAULT";;
github) SCM_GIT_CHAR="$SCM_GIT_CHAR_GITHUB" ;;
gitlab) SCM_GIT_CHAR="$SCM_GIT_CHAR_GITLAB" ;;
bitbucket) SCM_GIT_CHAR="$SCM_GIT_CHAR_BITBUCKET" ;;
*) SCM_GIT_CHAR="$SCM_GIT_CHAR_DEFAULT" ;;
esac
}
@ -74,7 +74,7 @@ function _exit-code {
function _prompt {
local exit_code="$?" wrap_char=' ' dir_color=$green ssh_info='' python_venv='' host command_duration=
command_duration=$(_command_duration)
command_duration=$( _command_duration)
_exit-code exit_code
_git-uptream-remote-logo
@ -100,11 +100,11 @@ function _prompt {
if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
python_venv="$PYTHON_VENV_CHAR${CONDA_DEFAULT_ENV} "
elif [[ -n "${VIRTUAL_ENV}" ]]; then
python_venv="$PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}") "
python_venv="$PYTHON_VENV_CHAR$( basename "${VIRTUAL_ENV}") "
fi
PS1="\\n${ssh_info} ${purple}$(scm_char)${python_venv}${dir_color}\\w${normal}$(scm_prompt_info)${command_duration}${exit_code}"
[[ ${#PS1} -gt $((COLUMNS*2)) ]] && wrap_char="\\n"
PS1="\\n${ssh_info} ${purple}$( scm_char)${python_venv}${dir_color}\\w${normal}$(scm_prompt_info)${command_duration}${exit_code}"
[[ ${#PS1} -gt $((COLUMNS * 2)) ]] && wrap_char="\\n"
PS1="${PS1}${wrap_char}${normal} "
}