Merge branch 'master' of vcs.univ.run:modules/nutools
This commit is contained in:
commit
12adf99dbf
|
@ -34,29 +34,51 @@ function pcd() {
|
|||
dir="$("@@dest@@/uproject" "get$prop")" || return 1
|
||||
[ -n "$dir" ] && cd "$dir"
|
||||
}
|
||||
function utools() {
|
||||
case "${1:-cycle}" in
|
||||
0|d|dis|disable) UTOOLS=;;
|
||||
1|e|ena|enable) UTOOLS=1;;
|
||||
f|full) UTOOLS=f;;
|
||||
cycle)
|
||||
case "$UTOOLS" in
|
||||
"") UTOOLS=1;;
|
||||
1) UTOOLS=f;;
|
||||
f) UTOOLS=;;
|
||||
function nutools() {
|
||||
if [ -n "$1" ]; then
|
||||
case "$1" in
|
||||
0|d|dis|disable) UTOOLS=;;
|
||||
1|e|ena|enable) UTOOLS=1;;
|
||||
f|full) UTOOLS=f;;
|
||||
cycle)
|
||||
case "$UTOOLS" in
|
||||
1) UTOOLS=f;;
|
||||
f) UTOOLS=;;
|
||||
*) UTOOLS=1;;
|
||||
esac
|
||||
;;
|
||||
n|np|nopush) NOPUSH=1;;
|
||||
push) NOPUSH=;;
|
||||
p|cyclep)
|
||||
case "$NOPUSH" in
|
||||
"") NOPUSH=1;;
|
||||
*) NOPUSH=;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
n|np|nopush) NOPUSH=1;;
|
||||
push) NOPUSH=;;
|
||||
p|cyclep)
|
||||
case "$NOPUSH" in
|
||||
"") NOPUSH=1;;
|
||||
*) NOPUSH=;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
echo "UTOOLS=$UTOOLS; NOPUSH=$NOPUSH" 1>&2
|
||||
echo "UTOOLS=$UTOOLS; NOPUSH=$NOPUSH" 1>&2
|
||||
else
|
||||
local PS3 prompt nopush
|
||||
echo "=== Type de prompt ===" 1>&2
|
||||
PS3="Veuillez choisir le type de prompt: "
|
||||
select prompt in Aucun$([ -z "$UTOOLS" ] && echo "*") Minimum$([ "$UTOOLS" == 1 ] && echo "*") Complet$([ "$UTOOLS" == f ] && echo "*"); do
|
||||
case "$prompt" in
|
||||
Aucun*) UTOOLS=; break;;
|
||||
Minimum*) UTOOLS=1; break;;
|
||||
Complet*) UTOOLS=f; break;;
|
||||
esac
|
||||
done
|
||||
echo "=== git push automatique ===" 1>&2
|
||||
PS3="Veuillez choisir le type de push: "
|
||||
select nopush in "Après git commit, faire git push$([ -z "$NOPUSH" ] && echo "*")" "Pas de git push auto$([ -n "$NOPUSH" ] && echo "*")"; do
|
||||
case "$nopush" in
|
||||
"Après git commit, faire git push"*) NOPUSH=; break;;
|
||||
"Pas de git push auto"*) NOPUSH=1; break;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
}
|
||||
function utools() { nutools "$@"; }
|
||||
|
||||
# Configuration
|
||||
__uaddpath "@@dest@@" PATH
|
||||
|
|
Loading…
Reference in New Issue