mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-19 22:41:48 +02:00
Fixed qpsh on CALMIP
This commit is contained in:
parent
78952d6e15
commit
82ffea992d
16
bin/qpsh
16
bin/qpsh
@ -3,22 +3,12 @@
|
|||||||
export QP_ROOT=$(dirname $0)/..
|
export QP_ROOT=$(dirname $0)/..
|
||||||
|
|
||||||
exec bash --init-file <(cat << EOF
|
exec bash --init-file <(cat << EOF
|
||||||
|
|
||||||
[[ -f \${HOME}/.bashrc ]] && source \${HOME}/.bashrc
|
[[ -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
|
source \${QP_ROOT}/quantum_package.rc
|
||||||
|
qp prompt
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
12
etc/qp.rc
12
etc/qp.rc
@ -96,6 +96,18 @@ function qp()
|
|||||||
man $QP_ROOT/man/${1}.?
|
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
|
_qp_usage
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user