Improve set_header.sh and doc
This commit is contained in:
@@ -3,14 +3,27 @@
|
||||
|
||||
# Set variables
|
||||
|
||||
if [ ! -z "$USER" ]
|
||||
if [ -f "~/.zshrc" ]
|
||||
then
|
||||
echo 'export USER=`whoami`' >> ~/.zshrc
|
||||
if ! grep -q ' USER=' "~/.zshrc" ] && [ -z "$USER" ]
|
||||
then
|
||||
echo 'export USER=`whoami`' >> ~/.zshrc
|
||||
fi
|
||||
if ! grep -q ' MAIL=' "~/.zshrc" ]
|
||||
then
|
||||
echo 'export MAIL="${USER}@student.42lausanne.ch"' >> ~/.zshrc
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -z "$MAIL" ]
|
||||
if [ -f "~/.bashrc" ]
|
||||
then
|
||||
echo 'export MAIL="${USER}@student.42lausanne.ch"' >> ~/.zshrc
|
||||
if ! grep -q ' USER=' "~/.bashrc" ] && [ -z "$USER" ]
|
||||
then
|
||||
echo 'export USER=`whoami`' >> ~/.bashrc
|
||||
fi
|
||||
if ! grep -q ' MAIL=' "~/.bashrc" ]
|
||||
then
|
||||
echo 'export MAIL="${USER}@student.42lausanne.ch"' >> ~/.bashrc
|
||||
fi
|
||||
fi
|
||||
|
||||
test -d ~/.vim/plugin || mkdir -p ~/.vim/plugin
|
||||
|
||||
Reference in New Issue
Block a user