-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_gitbash.sh
More file actions
67 lines (53 loc) · 2.09 KB
/
Copy pathsetup_gitbash.sh
File metadata and controls
67 lines (53 loc) · 2.09 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# install bash-it (for git-bash)
#if ! [ -x "$(command -v bash-it)" ]; then
if ! [ -d "/bash_it" ]; then
net session > /dev/null 2>&1
if [ $? -eq 0 ];
then echo "Installing bash-it ..."
else echo "Need to run shell as administrator to install bash-it"; exit 1;
fi
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
# create symlink to avoid issues with spaces in user paths
ln -s ~/.bash_it /bash_it
/bash_it/install.sh --silent
# make bash-it command available by refreshing shell
# source ~/.bashrc
fi
source ~/.bashrc
bash-it enable plugin autojump aws git extract z fzf
bash-it enable alias git curl
# set theme to minimal
sed -i 's/^export BASH_IT_THEME=.*/export BASH_IT_THEME="minimal"/' ~/.bashrc
sed -i 's/^export SCM_CHECK=.*/export SCM_CHECK=true/' ~/.bashrc
sed -i 's/^export SCM_GIT_SHOW_DETAILS=.*/export SCM_GIT_SHOW_DETAILS=true/' ~/.bashrc
sed -i 's/^export SCM_GIT_IGNO RE_UNTRACKED=.*/export SCM_GIT_IGNORE_UNTRACKED=true/' ~/.bashrc
# copy custom aliases
cp ./zsh/git.plugin.zsh /bash_it/aliases/custom.aliases.bash
cat .aliases >> /bash_it/aliases/custom.aliases.bash
# setup basic git configuration
echo "Verifying git configs..."
if [[ $(uname) =~ ^CYGWIN ]] || [[ $(uname) =~ ^MINGW ]];
then
git config --global credential.helper store ;
else
git config --global credential.helper cache ;
fi
echo "Git credential helper set"
cp ./git_global_attributes ~/.gitattributes
git config --global core.attributesfile '~/.gitattributes'
echo "Updated and set git global attributes"
cp ./git_global_ignore ~/.gitignore
git config --global core.excludesfile '~/.gitignore'
echo "Updated and set git global ignore"
if grep -Fq "bash_it_override.sh" ~/.bash_profile
then
echo "no need to modify bash_profile for bash_it_override.sh"
else
echo "test -f ~/.bash_it_override.sh && ~/.bash_it_override.sh" >> ~/.bash_profile
fi
cp ./bash_it_override.sh ~/.bash_it_override.sh
echo "Updated ~/.bash_it_override.sh"
echo "setup touchcursor"
cp ./touchcursor/settings.cfg $APPDATA/TouchCursor/settings.cfg
#refresh bash_profile
source ~/.bash_profile