-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·43 lines (34 loc) · 1.5 KB
/
install
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
#!/bin/sh
#
# This script is responsible to register commands you need
#
# Useage:
# install
#
# Installation:
# Put this file to some place then and chmod +x /path/to/script
# If yoo want to have a git alias for it, you can run the following command:
# set +H && git config --global alias.take-issue "!f(){ ~/path/to/script $1; }; f" && set -H
#
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source $DIR/common
sayHello
decision='Y'
saySmth "I'm going to add some usefull commands for you."
saySmth "First of all, git take-issue [ISSUE_ID]. The command will help to create a branch or download existing solution."
saySmth "Secondly, git review [branchName]. The command will help to create a PR in github."
saySmth "And finally, git prune-all. The command will help to remove branches which do not exist in remote repository."
saySmth "Additionally I'm going to set push.autoSetupRemote git config to true, so you don't need to set upstream for every new branch."
askSmth "Should I proceed? (Y/n)" decision
if [[ ${decision:l} != "n" ]]; then
set +H
logOperation 'Adding alias git take-issue...'
git config --global alias.take-issue "!f(){ $DIR/take_issue \$@; }; f"
logOperation 'Adding alias git review...'
git config --global alias.review "!f(){ $DIR/review \$@; }; f"
logOperation 'Adding alias git prune-all...'
git config --global alias.prune-all "!f(){ $DIR/prune \$@; }; f"
git config --global --add --bool push.autoSetupRemote true
fi
sayAllSet