Declaraive is more maintainable than imperative.
This commit is contained in:
parent
c519521834
commit
c68eb59d99
32
.bashrc
32
.bashrc
|
@ -1,6 +1,11 @@
|
||||||
# If not running interactively, don't do anything more
|
# If not running interactively, don't do anything more
|
||||||
[ -z "$PS1" ] && return
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
|
# Download .git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
|
||||||
|
# Download .fonts/dejavu/DejaVuSansMonoNerdFontCompleteMono.ttf https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.ttf
|
||||||
|
# Download .compile-python.sh https://git.afpy.org/mdk/compile-python/raw/branch/main/compile-python.sh
|
||||||
|
# Download .python-prompt.sh https://git.afpy.org/mdk/python-prompt/raw/branch/main/python-prompt.sh
|
||||||
|
|
||||||
DEBEMAIL=julien
|
DEBEMAIL=julien
|
||||||
DEBEMAIL=$DEBEMAIL@
|
DEBEMAIL=$DEBEMAIL@
|
||||||
DEBEMAIL=${DEBEMAIL}palard.fr
|
DEBEMAIL=${DEBEMAIL}palard.fr
|
||||||
|
@ -46,25 +51,18 @@ alias ls='ls --color=auto'
|
||||||
alias fingerprint='find /etc/ssh -name "*.pub" -exec ssh-keygen -l -f {} \;'
|
alias fingerprint='find /etc/ssh -name "*.pub" -exec ssh-keygen -l -f {} \;'
|
||||||
alias rekey='ssh-add -e /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so >/dev/null 2>&1; ssh-add -s /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so'
|
alias rekey='ssh-add -e /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so >/dev/null 2>&1; ssh-add -s /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so'
|
||||||
|
|
||||||
|
grep '^# Download ' $HOME/.bashrc | while read -r _ _ dest src
|
||||||
if ! [[ -f "$HOME/.git-prompt.sh" ]]
|
|
||||||
then
|
|
||||||
wget -q -O "$HOME/.git-prompt.sh" https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! [[ -f "$HOME/.fonts/dejavu/DejaVuSansMonoNerdFontCompleteMono.ttf" ]]
|
|
||||||
then
|
|
||||||
mkdir -p ~/.fonts/dejavu/
|
|
||||||
wget -qO "$HOME/.fonts/dejavu/DejaVuSansMonoNerdFontCompleteMono.ttf" "https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.ttf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for extra in /etc/bash_completion ~/.git-prompt.sh ~/clones/mdk/compile-python/compile-python.sh ~/clones/mdk/python-prompt/python-prompt.sh
|
|
||||||
do
|
do
|
||||||
if [[ -f "$extra" ]]
|
if [[ (! -f "$HOME/$dest") || $(( RANDOM % 100 )) == 0 ]]
|
||||||
then
|
then
|
||||||
. $extra
|
wget -q -O "$HOME/$dest" "$src"
|
||||||
fi
|
fi
|
||||||
|
if [[ "$dest" == *".sh" ]]
|
||||||
|
then
|
||||||
|
. "$dest"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
unset dest src
|
||||||
|
|
||||||
if [[ "$TERM" != 'dumb' ]]
|
if [[ "$TERM" != 'dumb' ]]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue