summaryrefslogtreecommitdiff
path: root/helpers/xfce-open-gitlab
blob: 2f3c0b3492310b3f128d7e06e16af88f4ec4e3ed (plain)
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
#!/usr/bin/env bash
# Small script to open the current projects GitLab page
# You can supply an argument to get to the respective subpage (e.g. "issues" or "tags")

GITLAB="https://gitlab.xfce.org"
APPS="xfce4-screensaver
	xfmpc
	xfdashboard
	xfce4-volumed-pulse
	xfce4-terminal
	xfce4-taskmanager
	xfce4-screenshooter
	xfce4-panel-profiles
	xfce4-notifyd
	xfce4-mixer
	xfce4-dict
	xfburn
	ristretto
	parole
	mousepad
	gigolo
	catfish
	"

# Check if we're in a git repo and get the name
is_git=$(git rev-parse --is-inside-work-tree)
if [ "$is_git" != "true" ]; then
	exit 1
else
	REPO=$(basename `git rev-parse --show-toplevel`)
fi

# Guess the GitLab group name
if [[ $APPS == *"$REPO"* ]]; then
	GROUP="apps"
elif [[ "$REPO" =~ "thunar-" ]]; then
	GROUP="thunar-plugins"
elif [[ "$REPO" =~ "-plugin" ]]; then
	GROUP="panel-plugins"
else
	GROUP="xfce"
fi

# Use the argument to go to subpages
if [ -n "$1" ]; then
	SLUG="-/$1"
else
	SLUG=""
fi

URL="$GITLAB/$GROUP/$REPO/$SLUG"

echo "Opening $URL in your browser..."
exo-open $URL