X-Git-Url: http://gitweb.pimeys.fr/?a=blobdiff_plain;f=.zsh%2Frc%2Flocal%2F03_profiling;fp=.zsh%2Frc%2Flocal%2F03_profiling;h=4a9feda49ae4220fb30402d5c0dfc499a690e243;hb=3d71eab53c5b63556363ece880859b0af7f162da;hp=0000000000000000000000000000000000000000;hpb=1f8b08895681d46802368eec0764ca70d08898ca;p=config-20-100.git diff --git a/.zsh/rc/local/03_profiling b/.zsh/rc/local/03_profiling new file mode 100644 index 0000000..4a9feda --- /dev/null +++ b/.zsh/rc/local/03_profiling @@ -0,0 +1,28 @@ +#!/bin/zsh +# Ce fichier contient des profils qui peuvent être chargés à la volée quand vous arrivez dans des dossiers +# spécifiques. Les lignes zstyle ne comprennent pas les variables genre ${HOME}, etc. +# +# Attention, si vous êtes dans /usr/scripts, et que vous allez dans lc_ldap, il ne rechargera pas de profil +# car le nom du profil est le même. +# Il faut donc créer des sous-profils pour les dépôts git différents. + +chpwd_profile_default(){ + [[ ${profile} == ${CHPWD_PROFILE} ]] && return 1 + umask 022 + return 0 +} + +chpwd_profile_sharedgit(){ + [[ ${profile} == ${CHPWD_PROFILE} ]] && return 1 + umask 002 + git status 2> /dev/null + + return 0 +} + +zstyle ':chpwd:profiles:/home/meh/git/scripts(|/|/*)' profile sharedgit +zstyle ':chpwd:profiles:/home/meh/git/bcfg2(|/|/*)' profile sharedgit +zstyle ':chpwd:profiles:/home/meh/git/lc_ldap(|/|/*)' profile sharedgit +zstyle ':chpwd:profiles:/usr/scripts(|/|/*)' profile sharedgit +zstyle ':chpwd:profiles:/usr/scripts/lc_ldap(|/|/*)' profile sharedgit +zstyle ':chpwd:profiles:/usr/scripts/intranet(|/|/*)' profile sharedgit