Fixed qpsh on CALMIP

This commit is contained in:
Anthony Scemama 2019-01-13 00:02:22 +01:00
parent 78952d6e15
commit 82ffea992d
2 changed files with 15 additions and 13 deletions

View File

@ -3,22 +3,12 @@
export QP_ROOT=$(dirname $0)/..
exec bash --init-file <(cat << EOF
[[ -f \${HOME}/.bashrc ]] && source \${HOME}/.bashrc
ESC=\$(printf "\\e")
function check_ezfio() {
if [[ -d \${EZFIO_FILE} ]] ; then
printf "\\e[0;32m|\${EZFIO_FILE}>\\e[m"
else
printf "\\e[0;31m|\${EZFIO_FILE}>\\e[m"
fi
}
PS1="\${PS1%$ }\\\$(check_ezfio) \$ "
source \${QP_ROOT}/quantum_package.rc
qp prompt
EOF
)

View File

@ -96,6 +96,18 @@ function qp()
man $QP_ROOT/man/${1}.?
;;
"prompt")
shift
function _check_ezfio() {
if [[ -d ${EZFIO_FILE} ]] ; then
printf "\e[0;32m|${EZFIO_FILE}>\e[m"
else
printf "\e[0;31m|${EZFIO_FILE}>\e[m"
fi
}
PS1="${PS1%\\\$ } \$(_check_ezfio) $ "
;;
*)
_qp_usage
;;