-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgremote
More file actions
47 lines (33 loc) · 1.01 KB
/
Copy pathgremote
File metadata and controls
47 lines (33 loc) · 1.01 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
# read input
# - read -p ' Current 0 (Master 1) ' branchName
# -
# - branchName=${branchName:-0}
# -
# - if [ "$branchName" == 1 ]
# - then
# - hub browse
# - exit
# - fi
# -
# - gh repo view --web
# - exit
# git@github.com:lmadhuranga/githubtools.git
currentRepo=$(git config --get remote.origin.url)
# echo $currentRepo
# lmadhuranga/githubtools.git
currentRepo=${currentRepo//"git@github.com:"/""}
# echo $currentRepo
# lmadhuranga/githubtools
currentRepo=${currentRepo//".git"/""}
currentBranch=$(git branch --show-current)
# Get Tiket id
ticketId=$(echo $currentBranch | cut -d "." -f 1)
repourl="https://github.com/$currentRepo"
gitUrl="$repourl/tree/$currentBranch"
prLink="$repourl/compare/$currentBranch"
projectUrl="$repourl/projects/1?fullscreen=true"
ticketUrl="$repourl/issues/$ticketId"
echo -e "\033[35mprojectUrl => \033[0m$projectUrl\n"
echo -e "\033[34mBranch => \033[0m$gitUrl"
echo -e "\033[33mPr => \033[0m$prLink"
echo -e "\033[32mticketUrl => \033[0m$ticketUrl "