-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgit-flow.sh
executable file
·36 lines (29 loc) · 1.28 KB
/
git-flow.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
#!/usr/bin/env bash
if ($(aptitude show git-core > /dev/null 2>&1)) then
installed=$(apt-cache policy git-core | grep Installed:)
candidate=$(apt-cache policy git-core | grep Candidate:)
if [[ ${installed/Installed: } != ${candidate/Candidate: } ]]
then sudo apt-get upgrade -y git-core;
fi
else sudo apt-get install -y git-core;
fi
if ($(aptitude show bash-completion > /dev/null 2>&1))
then
installed=$(apt-cache policy bash-completion | grep Installed:)
candidate=$(apt-cache policy bash-completion | grep Candidate:)
if [[ ${installed/Installed: } != ${candidate/Candidate: } ]]
then sudo apt-get upgrade -y bash-completion;
fi
else sudo apt-get install -y bash-completion;
fi
if ($(aptitude show git-flow > /dev/null 2>&1)) then
installed=$(apt-cache policy git-flow | grep Installed:)
candidate=$(apt-cache policy git-flow | grep Candidate:)
if [[ ${installed/Installed: } != ${candidate/Candidate: } ]]
then sudo apt-get upgrade -y git-flow;
fi
else sudo apt-get install -y git-flow;
fi
# git flow autocomplete
sudo bash -c "curl -sL https://raw.githubusercontent.com/bobthecow/git-flow-completion/master/git-flow-completion.bash > /etc/bash_completion.d/git-flow"
. /etc/bash_completion.d/git-flow