si pas zshrc message plus complet

This commit is contained in:
hugodu69
2019-02-06 04:26:07 +01:00
parent 7ce0816902
commit 2285a63191

View File

@@ -11,8 +11,10 @@
SCREEN="$HOME/.screenrc" SCREEN="$HOME/.screenrc"
MYSCREEN="$HOME/config/.screenrc" MYSCREEN="$HOME/config/.screenrc"
VIM="$HOME/.vimrc" VIM="$HOME/.vimrc"
MYVIM="$HOME/config/.vimrc" MYVIM="$HOME/config/.vimrc"
ZSH="$HOME/.zshrc" ZSH="$HOME/.zshrc"
MYZSH="$HOME/config/.zshrc" MYZSH="$HOME/config/.zshrc"
@@ -21,13 +23,15 @@ MYZSH="$HOME/config/.zshrc"
# action on the .screenrc file # action on the .screenrc file
# ------------------------------------------------------------- # -------------------------------------------------------------
if [ -f $SCREEN ]; if [ -f $SCREEN ]; then
then if [ ! -L $SCREEN ]; then
if grep -q '#hugogogo#' $SCREEN; if grep -q '#hugogogo#' $SCREEN;
then then
sed '/#hugogogo#/,/#hugogogo#/d' $SCREEN > $SCREEN.tmp && mv $SCREEN.tmp $SCREEN sed '/#hugogogo#/,/#hugogogo#/d' $SCREEN > $SCREEN.tmp
mv $SCREEN.tmp $SCREEN
fi fi
cat $MYSCREEN >> $SCREEN cat $MYSCREEN >> $SCREEN
fi
else else
ln -s $MYSCREEN $SCREEN ln -s $MYSCREEN $SCREEN
fi fi
@@ -37,13 +41,15 @@ fi
# action on the .vimrc file # action on the .vimrc file
# ------------------------------------------------------------- # -------------------------------------------------------------
if [ -f $VIM ]; if [ -f $VIM ]; then
then if [ ! -L $VIM ]; then
if grep -q '"hugogogo"' $VIM; if grep -q '"hugogogo"' $VIM;
then then
sed '/"hugogogo"/,/"hugogogo"/d' $VIM > $VIM.tmp && mv $VIM.tmp $VIM sed '/"hugogogo"/,/"hugogogo"/d' $VIM > $VIM.tmp
mv $VIM.tmp $VIM
fi fi
cat $MYVIM >> $VIM cat $MYVIM >> $VIM
fi
else else
ln -s $MYVIM $VIM ln -s $MYVIM $VIM
fi fi
@@ -57,10 +63,16 @@ if [ -f $ZSH ];
then then
if grep -q '#hugogogo#' $ZSH; if grep -q '#hugogogo#' $ZSH;
then then
sed '/#hugogogo#/,/#hugogogo#/d' $ZSH > $ZSH.tmp && mv $ZSH.tmp $ZSH sed '/#hugogogo#/,/#hugogogo#/d' $ZSH > $ZSH.tmp
mv $ZSH.tmp $ZSH
fi fi
cat $MYZSH >> $ZSH cat $MYZSH >> $ZSH
else else
echo "install zsh to run the dynamic title on screen" echo "you don't have a .zshrc file in your \$HOME directory"
echo "maybe you should verify if you have zsh :"
echo "run 'zsh --version'"
echo "and if not, install it, otherwise create a .zshrc file"
echo "now run the script README.txt again"
echo "to set the dynamic title on screen"
fi fi