Files
42header/set_header.sh

35 lines
679 B
Bash
Raw Normal View History

#!/bin/bash
# ./set_header.sh
# Set variables
2021-10-29 08:30:44 +02:00
if [ -f "~/.zshrc" ]
then
2021-10-29 08:30:44 +02:00
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
2021-10-29 08:30:44 +02:00
if [ -f "~/.bashrc" ]
then
2021-10-29 08:30:44 +02:00
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
# Add stdheader to vim plugins
cp vim/stdheader.vim ~/.vim/plugin/
source ~/.zshrc