summaryrefslogtreecommitdiffstats
path: root/helperscripts/github-pull
blob: 22c44d141b9cd134c28dc8ad89f9ddba8a5b0365 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

die()
{
	echo "$*" >&2
	exit 1
}

[ $# -eq 2 ] || die "Usage: github-pull PROJECTNAME USER:BRANCH"
project="$1"
user_branch="$2"

user="$(printf '%s' "$user_branch" | cut -f1 -d':')"
branch="$(printf '%s' "$user_branch" | cut -f2 -d':')"
[ -n "$user" ] || die "Invalid user name"
[ -n "$branch" ] || die "Invalid branch name"

url="https://github.com/$user/$project.git"

echo git pull "$url" "$branch"
exec git pull "$url" "$branch"
bues.ch cgit interface