-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
39 lines (31 loc) · 1.14 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /usr/bin/env bash
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
echo Script directory: $DIR
# Add source env to bashrc (unless it's already there somehow)
echo -e '\nInstalling glass-bash...\n'
grep -qxF 'source '$DIR'/main' $HOME/.bashrc || echo 'source '$DIR'/main' >>$HOME/.bashrc
# VIM settings
echo -e '\nCopying VIM settings...\n'
cp ./.vimrc $HOME/.vimrc
# Make sure an SSH key exists
echo -e '\nChecking for SSH key...\n'
if [ ! -e $HOME/.ssh ]; then
echo -e '\nCreating SSH key...\n'
ssh-keygen -t rsa
else
echo -e '\n\e[95mNOTICE\e[0m: ssh key already exists.'
fi
# Set git user info
echo -e '\nSetting Git user info...\n'
read -p 'Please enter your Git username: ' gituser
read -p 'Please enter your Git email: ' gitemail
git config --global user.name "$gituser"
git config --global user.email "$gitemail"
# Set git to globally ignore ipynb_checkpoints
rm -f ~/.gitignore
ln -s $DIR/gitignore ~/.gitignore
git config --global core.excludesfile '~/.gitignore'
# Set default name for new git repos
git config --global init.defaultBranch main
############################################
echo -e '\nglass-bash setup is complete!\n'